Skip to content

Fix IllegalAccessError in AnvilInventoryImpl - #2552

Open
bwachtendorf wants to merge 1 commit into
stefvanschie:masterfrom
bwachtendorf:fix-illegal-access-error
Open

Fix IllegalAccessError in AnvilInventoryImpl#2552
bwachtendorf wants to merge 1 commit into
stefvanschie:masterfrom
bwachtendorf:fix-illegal-access-error

Conversation

@bwachtendorf

Copy link
Copy Markdown

On paper minecraft 26.2 I was getting following error when trying to open an anvil GUI:

java.lang.IllegalAccessError: class com.github.stefvanschie.inventoryframework.nms.v26_1.AnvilInventoryImpl$ContainerAnvilImpl tried to access private field net.minecraft.world.inventory.Slot.slot (com.github.stefvanschie.inventoryframework.nms.v26_1.AnvilInventoryImpl$ContainerAnvilImpl is in unnamed module of loader 'WaystoneWarps-1.1.0-SNAPSHOT.jar' @5e9ada49; net.minecraft.world.inventory.Slot is in unnamed module of loader java.net.URLClassLoader @433c675d)
   at WaystoneWarps-1.1.0-SNAPSHOT.jar//com.github.stefvanschie.inventoryframework.nms.v26_1.AnvilInventoryImpl$ContainerAnvilImpl.updateSlot(AnvilInventoryImpl.java:223) ~[?:?]
   at WaystoneWarps-1.1.0-SNAPSHOT.jar//com.github.stefvanschie.inventoryframework.nms.v26_1.AnvilInventoryImpl$ContainerAnvilImpl.<init>(AnvilInventoryImpl.java:134) ~[?:?]
   at WaystoneWarps-1.1.0-SNAPSHOT.jar//com.github.stefvanschie.inventoryframework.nms.v26_1.AnvilInventoryImpl$1$1.createMenu(AnvilInventoryImpl.java:60) ~[?:?]

This fixes the issue by using the appropriate public function.

@stefvanschie

Copy link
Copy Markdown
Owner

Regression caused by PaperMC/Paper@0ae1b42.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants