Breaking or placing spawner without entitytype set, brings exception
ByteExceptionM opened this issue ยท 1 comments
Due to api changes in spigot (1.20), the EntityType of a spawner is now annotated with @nullable. Trying to break or place a spawner, the following exceptions occur:
java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.EntityType.name()" because "type" is null
[10:51:59 WARN]: at CoreProtect-21.3.jar//net.coreprotect.utility.Util.getEntityId(Util.java:800)
[10:51:59 WARN]: at CoreProtect-21.3.jar//net.coreprotect.utility.Util.getSpawnerType(Util.java:900)
[10:51:59 WARN]: at CoreProtect-21.3.jar//net.coreprotect.consumer.Queue.queueBlockBreak(Queue.java:103)
[10:51:59 WARN]: at CoreProtect-21.3.jar//net.coreprotect.consumer.Queue.queueBlockBreak(Queue.java:84)
[10:51:59 WARN]: at CoreProtect-21.3.jar//net.coreprotect.CoreProtectAPI.logRemoval(CoreProtectAPI.java:331)
[10:59:40 ERROR]: Could not pass event BlockPlaceEvent to CoreProtect v21.3
java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.EntityType.name()" because "type" is null
at net.coreprotect.utility.Util.getEntityId(Util.java:800) ~[CoreProtect-21.3.jar:?]
at net.coreprotect.utility.Util.getSpawnerType(Util.java:900) ~[CoreProtect-21.3.jar:?]
at net.coreprotect.consumer.Queue.queueBlockPlace(Queue.java:144) ~[CoreProtect-21.3.jar:?]
at net.coreprotect.listener.block.BlockPlaceListener.onBlockPlace(BlockPlaceListener.java:107) ~[CoreProtect-21.3.jar:?]
at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:git-Paper-17]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.jar:git-Paper-17]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.jar:git-Paper-17]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.event.CraftEventFactory.callBlockPlaceEvent(CraftEventFactory.java:415) ~[paper-1.20.jar:git-Paper-17]
at net.minecraft.world.item.ItemStack.useOn(ItemStack.java:412) ~[paper-1.20.jar:git-Paper-17]
at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:596) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1960) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:37) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.a(ServerboundUseItemOnPacket.java:9) ~[?:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:51) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.jar:git-Paper-17]
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:1339) ~[paper-1.20.jar:git-Paper-17]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[paper-1.20.jar:git-Paper-17]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1316) ~[paper-1.20.jar:git-Paper-17]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1309) ~[paper-1.20.jar:git-Paper-17]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1287) ~[paper-1.20.jar:git-Paper-17]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1175) ~[paper-1.20.jar:git-Paper-17]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.jar:git-Paper-17]
at java.lang.Thread.run(Thread.java:1589) ~[?:?]
I'm using CoreProtect 21.3
Fixed in #381