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

Could not pass event PrepareAnvilEvent to CustomAnvil v1.7.0 #47

Closed
cupang-afk opened this issue Jan 23, 2025 · 6 comments · Fixed by #48
Closed

Could not pass event PrepareAnvilEvent to CustomAnvil v1.7.0 #47

cupang-afk opened this issue Jan 23, 2025 · 6 comments · Fixed by #48
Assignees
Labels
bug Something isn't working

Comments

@cupang-afk
Copy link

all i did is use the anvil

[19:07:09 ERROR]: Could not pass event PrepareAnvilEvent to CustomAnvil v1.7.0
java.lang.NullPointerException: null
[19:07:09 ERROR]: Could not pass event PrepareAnvilEvent to CustomAnvil v1.7.0
java.lang.NullPointerException: null
[19:07:09 ERROR]: Could not pass event PrepareAnvilEvent to CustomAnvil v1.7.0
java.lang.NullPointerException: null

i have Disenchantment 6.1.1, EnchantsSquared 2.5.15

@cupang-afk cupang-afk added the bug Something isn't working label Jan 23, 2025
@alexcrea
Copy link
Owner

alexcrea commented Jan 24, 2025

Hi, This configuration seems to work on my side with paper 1.21.4
What server version and firmware are you using ? (for example, paper 1.21.4) (use /version in server)
Is there any error or info log created by CustomAnvil at startup ?

Also, seems like the provided error do not have stack trace. Did you disable it somehow ?
If it is indeed disabled and you know how to re-enable it on your side I recommend doing it (at least temporarily), try to use the anvil, and then sending me the stack trace of the error as it would allow me to find more easily the cause of the problem

Also, do you have any other plugin that may impact the anvil mechanic ?

@cupang-afk
Copy link
Author

Hi, This configuration seems to work on my side with paper 1.21.4 What server version and firmware are you using ? (for example, paper 1.21.4) (use /version in server) Is there any error or info log created by CustomAnvil at startup ?

Also, seems like the provided error do not have stack trace. Did you disable it somehow ? If it is indeed disabled and you know how to re-enable it on your side I recommend doing it (at least temporarily), try to use the anvil, and then sending me the stack trace of the error as it would allow me to find more easily the cause of the problem

Also, do you have any other plugin that may impact the anvil mechanic ?

im using divinemc 1.21.3 build 418, the custom anvil mechanic work just fine

it trigger error whenever an armor or anything item has EnchantsSquared enchant on, and try to put into the anvil (in my test i always put to slot 1)

i didnt do anything about stack trace, it just like that somehow which im also confused

sometime it also trigger rename error cuz str is null or something (i was lowering custom anvil version from 1.7.0 to 1.6.13 and disenchant to 5.x cuz i thought it could fix this i guess im wrong)

[15:07:16 ERROR]: Could not pass event PrepareAnvilEvent to CustomAnvil v1.6.13
java.lang.NullPointerException: Cannot invoke "String.length()" because "str" is null
        at java.base/java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:118) ~[?:?]
        at java.base/java.lang.StringBuilder.<init>(StringBuilder.java:131) ~[?:?]
        at CustomAnvil [1.6.13].jar/xyz.alexcrea.cuanvil.listener.PrepareAnvilListener.handleRename(PrepareAnvilListener.kt:128) ~[CustomAnvil [1.6.13].jar:?]
        at CustomAnvil [1.6.13].jar/xyz.alexcrea.cuanvil.listener.PrepareAnvilListener.doRenaming(PrepareAnvilListener.kt:101) ~[CustomAnvil [1.6.13].jar:?]
        at CustomAnvil [1.6.13].jar/xyz.alexcrea.cuanvil.listener.PrepareAnvilListener.anvilCombineCheck(PrepareAnvilListener.kt:61) ~[CustomAnvil [1.6.13].jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor837.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[divinemc-api-1.21.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:72) ~[divinemc-api-1.21.3-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:60) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:630) ~[divinemc-api-1.21.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.event.Event.callEvent(Event.java:55) ~[divinemc-api-1.21.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(CraftEventFactory.java:1832) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.ItemCombinerMenu.slotsChanged(ItemCombinerMenu.java:102) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.ItemCombinerMenu$4.setChanged(ItemCombinerMenu.java:92) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.SimpleContainer.setItem(SimpleContainer.java:226) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.Slot.set(Slot.java:66) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.Slot.setByPlayer(Slot.java:62) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.Slot.setByPlayer(Slot.java:58) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.AbstractContainerMenu.moveItemStackTo(AbstractContainerMenu.java:930) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.AbstractContainerMenu.moveItemStackTo(AbstractContainerMenu.java:836) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.ItemCombinerMenu.quickMoveStack(ItemCombinerMenu.java:146) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.AbstractContainerMenu.doClick(AbstractContainerMenu.java:577) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.world.inventory.AbstractContainerMenu.clicked(AbstractContainerMenu.java:420) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3350) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:69) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:33) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:55) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1621) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:204) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:128) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1598) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1591) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.util.thread.BlockableEventLoop.runAllTasks(BlockableEventLoop.java:117) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1548) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1388) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:341) ~[divinemc-1.21.3.jar:1.21.3-418-e58b0d0]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

i have other plugin related to anvil named Geyser Recipe Fix, but that error was happen when testing on java so i dont think it related (i didnt test on geyser/bedrock tho)

@alexcrea
Copy link
Owner

alexcrea commented Jan 24, 2025

I found the reason of the second issue, but first one, still have no idea why
as by your description it seems to only happen with enchantment squared, I just will make more safeguard & proper error log to be safe. So I will soon give you a jar that should at least help debug the issue.
btw, could not still reproduce the issue on my side sadly

@alexcrea
Copy link
Owner

@cupang-afk
Copy link
Author

could you test with https://github.com/alexcrea/CustomAnvil/releases/tag/v1.7.1-test1 ?

i can confirm this doesn't trigger the log error anymore (including the first one)

@alexcrea
Copy link
Owner

could you test with https://github.com/alexcrea/CustomAnvil/releases/tag/v1.7.1-test1 ?

i can confirm this doesn't trigger the log error anymore (including the first one)

Oh ? I guess the first issue has the same cause as the same as the second one. Just stack trace somehow did not get printed
I will be uploading the version or spigot, modrinth, hangar later

@alexcrea alexcrea linked a pull request Jan 25, 2025 that will close this issue
@alexcrea alexcrea mentioned this issue Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants