Skip to content

The GUI rename prompt crashes on Paper 1.21.11: AnvilGUI looks up the Spigot-mapped EntityHuman #77

Description

@milanmalhotra

Clicking Rename in the per-home management menu throws and the anvil prompt
never opens. Renaming from the GUI is unusable on Paper 1.21.11.

Found by a new end-to-end spec written for #76, driving the real GUI with a
player bot against the shaded jar on a real server. The unit suite cannot see
this: it exercises HomeActionsGui.applyRename directly and never constructs
AnvilGUI, which is exactly the gap CLAUDE.md records.

[Server thread/ERROR]: Could not pass event InventoryClickEvent to SetHomesTwo v1.2.2
java.lang.NoClassDefFoundError: net/minecraft/world/entity/player/EntityHuman
	at java.base/java.lang.Class.forName(Class.java:513)
	at io.papermc.reflectionrewriter.runtime.AbstractDefaultRulesReflectionProxy.forName
	at io.papermc.paper.pluginremap.reflect.PaperReflectionHolder.forName
	at com.samleighton.sethomestwo.lib.anvilgui.version.VersionMatcher.match(VersionMatcher.java:61)
	at com.samleighton.sethomestwo.lib.anvilgui.AnvilGUI.<clinit>(AnvilGUI.java:43)
	at com.samleighton.sethomestwo.lib.anvilgui.AnvilGUI$Builder.<init>(AnvilGUI.java:428)
	at com.samleighton.sethomestwo.gui.HomeActionsGui.openRenamePrompt(HomeActionsGui.java:340)
	at com.samleighton.sethomestwo.gui.HomeActionsGui.onClick(HomeActionsGui.java:262)

A second click reports Could not initialize class ...lib.anvilgui.AnvilGUI,
the follow-on from the failed static initializer.

EntityHuman is the Spigot mapped name. Paper serves Mojang mappings, where the
class is net.minecraft.world.entity.player.Player, and Paper's reflection
rewriter did not translate the lookup. AnvilGUI is pinned to
1.10.13-20260714.043149-1, the only snapshot upstream publishes.

Observed on Paper 1.21.11 build 34 under the end-to-end harness, running the
same SetHomesTwo-1.2.2.jar that ships. The local test server in ../Spigot is
Paper 1.21.11 build 132, the same mappings, so it should reproduce there by hand:
/create-home base, /homes, right-click the home, click Rename.

Worth checking whether a newer AnvilGUI snapshot resolves it, and whether the
sh2.manage-homes rename path should fail closed with a message to the player
rather than throwing out of the event handler.

The end-to-end spec that found it is written and passing up to the point of the
crash. It is held out of #76 so the suite stays green, and goes in with the fix:
click Rename, wait for the New home name window, write the serverbound
name_item packet, then click slot 2 and assert base has been renamed to renamed. A second case covers renaming onto a name already taken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions