ExplosiveMine / Anvil-Revamp

Open an anvil anywhere!
MIT License
0 stars 3 forks source link

NullPointerException in another plugin that uses anvil UI #3

Closed marcelschoen closed 1 year ago

marcelschoen commented 1 year ago

I am using the super-cool "Fancy Waystones" plugin which creates teleportation waystones. A user can right-click a waystone to open a UI and then there click an option to rename the waystone. It then opens the anvil UI to enter a new name. It works, but I noticed that I got these exceptions in the console (I am using version 1.3.3 of the anvil plugin):

[20:28:21 ERROR]: Could not pass event PrepareAnvilEvent to Anvil v1.3.3
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "org.bukkit.inventory.AnvilInventory.getRenameText()" is null
    at io.github.explosivemine.anvil.listeners.AnvilEvents.onPrepareAnvil(AnvilEvents.java:41) ~[Anvil.jar:?]
    at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor762.execute(Unknown Source) ~[?:?]
    at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-261]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.event.Event.callEvent(Event.java:45) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callPrepareResultEvent(CraftEventFactory.java:1673) ~[paper-1.19.2.jar:git-Paper-261]
    at net.minecraft.world.inventory.ItemCombinerMenu.slotsChanged(ItemCombinerMenu.java:81) ~[?:?]
    at net.minecraft.world.inventory.ItemCombinerMenu$1.setChanged(ItemCombinerMenu.java:25) ~[?:?]
    at net.minecraft.world.SimpleContainer.setItem(SimpleContainer.java:203) ~[?:?]
    at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftResultInventory.setItem(CraftResultInventory.java:37) ~[paper-1.19.2.jar:git-Paper-261]
    at net.wesjd.anvilgui.AnvilGUI.openInventory(AnvilGUI.java:179) ~[FancyWaystones.jar:?]
    at net.wesjd.anvilgui.AnvilGUI.<init>(AnvilGUI.java:164) ~[FancyWaystones.jar:?]
    at net.wesjd.anvilgui.AnvilGUI.<init>(AnvilGUI.java:30) ~[FancyWaystones.jar:?]
    at net.wesjd.anvilgui.AnvilGUI$Builder.open(AnvilGUI.java:486) ~[FancyWaystones.jar:?]
    at thito.fancywaystones.gui.items.WaystoneRenameItem.lambda$handle$3(WaystoneRenameItem.java:108) ~[FancyWaystones.jar:?]
    at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.2.jar:git-Paper-261]
    at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[paper-1.19.2.jar:git-Paper-261]
    at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1473) ~[paper-1.19.2.jar:git-Paper-261]
    at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446) ~[paper-1.19.2.jar:git-Paper-261]
    at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1397) ~[paper-1.19.2.jar:git-Paper-261]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.2.jar:git-Paper-261]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-261]
    at java.lang.Thread.run(Unknown Source) ~[?:?]

The other plugin, for the fancy waystones, is this one: https://www.spigotmc.org/resources/fancywaystones-waystones-and-waypoints-the-best-teleporter-and-location-marker-plugin.94376/

While it happens when using another plugin, the stacktrace indicates that it happens in the Anvil plugin code, which is why I am reporting it here.

ExplosiveMine commented 1 year ago

Please try with this release and let me know if it fixes things https://github.com/ExplosiveMine/Anvil-Revamp/releases/tag/1.3.4-alpha.1 If need be, reopen an issue since I'm closing this one as I'm 90% sure its fixed