EngineHub / CraftBook

🔧 Machines, ICs, PLCs, and more!
https://enginehub.org/craftbook/
GNU General Public License v3.0
301 stars 160 forks source link

Exception using Cauldron #1301

Closed Capri205 closed 2 years ago

Capri205 commented 2 years ago

CraftBook Version

3.10.6

Platform Version

CraftBukkit version 3473-Spigot-ffceeae-2542945 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT)

Confirmations

Bug Description

Hi. I get the following exception when adding water to a cauldron that has a netherrack fire under it.

[23:26:31] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to CraftBook v3.10.6;4748-a91298e org.bukkit.event.EventException: null at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_18_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:505) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:496) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1547) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.network.protocol.game.PacketPlayInUseItem.a(PacketPlayInUseItem.java:33) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.network.protocol.game.PacketPlayInUseItem.a(PacketPlayInUseItem.java:1) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1190) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.util.thread.IAsyncTaskHandler.y(SourceFile:131) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.MinecraftServer.be(MinecraftServer.java:1169) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1162) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:140) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1146) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1051) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3463-Spigot-ffceeae-953d3dd] at java.lang.Thread.run(Thread.java:833) [?:?] Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.Levelled (org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData and org.bukkit.block.data.Levelled are in unnamed module of loader java.net.URLClassLoader @2e5d6d97) at com.sk89q.craftbook.mechanics.cauldron.ImprovedCauldron.isCauldron(ImprovedCauldron.java:109) ~[?:?] at com.sk89q.craftbook.mechanics.cauldron.ImprovedCauldron.onRightClick(ImprovedCauldron.java:122) ~[?:?] at jdk.internal.reflect.GeneratedMethodAccessor45.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.18.2-R0.1-SNAPSHOT.jar:?] ... 22 more

Expected Behavior

No exception. Following the exception the cauldron doesn't work as per the documentation.

Reproduction Steps

  1. Place netherrack
  2. Light netherrack with flint and steel
  3. Place cauldron above fire
  4. use water bucket to fill cauldron

Anything Else?

No response

me4502 commented 2 years ago

It appears this was caused by a bug in Spigot, I've added a workaround in the latest build.