Theguyhere0 / villager-defense-minigame

A Minecraft plugin that adds a fun, customizable minigame where players defend villagers against waves of monsters
GNU General Public License v3.0
6 stars 4 forks source link

[BUG] #166

Closed D3dWiz closed 11 months ago

D3dWiz commented 11 months ago

Describe the bug Clicking on New Arena in the Admin > Arenas panel gives this error and creates an Emerald block with the name "Edit null"

Could not pass event InventoryClickEvent to VillagerDefense v1.2.8 java.lang.IndexOutOfBoundsException: readerIndex(8) + length(1) exceeds writerIndex(8): UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf(ridx: 8, widx: 8, cap: 256) at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1442) ~[netty-buffer-4.1.87.Final.jar:4.1.87.Final] at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:730) ~[netty-buffer-4.1.87.Final.jar:4.1.87.Final] at io.netty.buffer.AbstractByteBuf.readBoolean(AbstractByteBuf.java:739) ~[netty-buffer-4.1.87.Final.jar:4.1.87.Final] at net.minecraft.network.FriendlyByteBuf.readBoolean(FriendlyByteBuf.java:1282) ~[?:?] at net.minecraft.network.protocol.game.ClientboundOpenSignEditorPacket.<init>(ClientboundOpenSignEditorPacket.java:18) ~[?:?] at me.theguyhere.villagerdefense.nms.v1_20_r1.OpenSignEditorPacket.<init>(OpenSignEditorPacket.java:16) ~[VillagerDefense-1.2.8.jar:?] at me.theguyhere.villagerdefense.nms.v1_20_r1.VersionNMSManager.nameArena(VersionNMSManager.java:76) ~[VillagerDefense-1.2.8.jar:?] at me.theguyhere.villagerdefense.plugin.listeners.InventoryListener.onClick(InventoryListener.java:260) ~[VillagerDefense-1.2.8.jar:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1166.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:git-Purpur-2010] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.1.jar:git-Purpur-2010] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.1.jar:git-Purpur-2010] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3295) ~[?:?] at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:58) ~[?:?] at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:23) ~[?:?] at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:51) ~[?:?] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.1.jar:git-Purpur-2010] at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?] at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1366) ~[purpur-1.20.1.jar:git-Purpur-2010] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[purpur-1.20.1.jar:git-Purpur-2010] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1343) ~[purpur-1.20.1.jar:git-Purpur-2010] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1336) ~[purpur-1.20.1.jar:git-Purpur-2010] at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?] at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1314) ~[purpur-1.20.1.jar:git-Purpur-2010] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[purpur-1.20.1.jar:git-Purpur-2010] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2010] at java.lang.Thread.run(Thread.java:833) ~[?:?]

To Reproduce Clean install latest version on 1.20.1 Write /vd admin Click on Arenas Click on New Arena

Expected behavior Create a new arena I suppose, I'm new to the plugin

Screenshots image

Server and plugin versions (please complete the following information):

Additional context Also another problem I find is that the plugin always listens to onPlayerMove even if they're not in arena (I just put the plugin and I haven't even created one). In the screenshot the % isn't really big but it gets heavy when many players join.

Screenshot: image

Theguyhere0 commented 11 months ago

Thanks for the update, I'll look into why the naming thing is broken. With regard to the player move check, I've optimized it in the upcoming v2, so I won't be fixing that for v1 since I plan to transition old mechanics into the v2 as well.

D3dWiz commented 11 months ago

Is there any ETA for when the v2 will be ready if it's not too much to ask~