Skip to content

Update CommonVertexElement.java to fix offsets#545

Open
Meamzy wants to merge 1 commit intoAsek3:1.20/devfrom
Meamzy:patch-1
Open

Update CommonVertexElement.java to fix offsets#545
Meamzy wants to merge 1 commit intoAsek3:1.20/devfrom
Meamzy:patch-1

Conversation

@Meamzy
Copy link

@Meamzy Meamzy commented Jul 29, 2023

There is an issue with the minecraft source code where the offsets field is declared private and can't be accessed by the CommonVertexElement.java:
at
var offsets = format.offsets;

Decompiled minecraft code with infused forge:
at VertexFormat.java
private final IntList offsets = new IntArrayList();

But the VertexFromat class has a getOffset method that uses indexes:
public int getOffset(int index) { return offsets.getInt(index); }

So I've used that method to get the offsets inside of the for loop.

The initial error I've got while trying to run minecraft:

Error: java.lang.IllegalAccessError: class me.jellysquid.mods.sodium.client.render.vertex.transform.CommonVertexElement tried to access private field com.mojang.blaze3d.vertex.VertexFormat.f_86013_ (me.jellysquid.mods.sodium.client.render.vertex.transform.CommonVertexElement is in module rubidium@0.6.5 of loader 'TRANSFORMER' @19bedeb8; com.mojang.blaze3d.vertex.VertexFormat is in module minecraft@1.20.1 of loader 'TRANSFORMER' @19bedeb8)

Minecraft version 1.20.1
Forge version: forge-1.20.1-47.1.0

Related issue:
#543

There is an issue with the minecraft source code where the offsets field is declared private and can't be accessed by the CommonVertexElement.java:
at `var offsets = format.offsets;`

Decompiled minecraft code with infused forge:
   private final IntList offsets = new IntArrayList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant