Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CommonVertexElement.java to fix offsets #545

Open
wants to merge 1 commit into
base: 1.20/dev
Choose a base branch
from

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 [email protected] of loader 'TRANSFORMER' @19bedeb8; com.mojang.blaze3d.vertex.VertexFormat is in module [email protected] 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