ClassCastException: java.lang.String cannot be cast to java.lang.Number
Oruss7 opened this issue ยท 2 comments
Bug report
What are you trying to do ?
Teleport horse
What is the expected behavior ?
Teleported horse
What is the actual behavior ?
Stacktrace on console
How to reproduce the bug ?
- /zh here serge
Console output
[11:17:53] [Server thread/INFO]: bibo7 issued server command: /zh here serge
[11:17:54] [Server thread/WARN]: java.lang.reflect.InvocationTargetException
[11:17:54] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[11:17:54] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[11:17:54] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[11:17:54] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[11:17:54] [Server thread/WARN]: at com.github.xibalba.zhorse.managers.CommandManager.onCommand(CommandManager.java:57)
[11:17:54] [Server thread/WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
[11:17:54] [Server thread/WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
[11:17:54] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1397)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1232)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13)
[11:17:54] [Server thread/WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[11:17:54] [Server thread/WARN]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679)
[11:17:54] [Server thread/WARN]: at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577)
[11:17:54] [Server thread/WARN]: at java.lang.Thread.run(Thread.java:748)
[11:17:54] [Server thread/WARN]: Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
[11:17:54] [Server thread/WARN]: at org.bukkit.inventory.ItemStack.deserialize(ItemStack.java:529)
[11:17:54] [Server thread/WARN]: at com.github.xibalba.zhorse.database.InventoryItemRecord.getItem(InventoryItemRecord.java:56)
[11:17:54] [Server thread/WARN]: at com.github.xibalba.zhorse.managers.HorseManager.assignInventory(HorseManager.java:257)
[11:17:54] [Server thread/WARN]: at com.github.xibalba.zhorse.managers.HorseManager.spawnHorse(HorseManager.java:309)
[11:17:54] [Server thread/WARN]: at com.github.xibalba.zhorse.managers.HorseManager.getHorse(HorseManager.java:72)
[11:17:54] [Server thread/WARN]: at com.github.xibalba.zhorse.commands.CommandHere.execute(CommandHere.java:36)
[11:17:54] [Server thread/WARN]: at com.github.xibalba.zhorse.commands.CommandHere.(CommandHere.java:29)
[11:17:54] [Server thread/WARN]: ... 21 more
Environment specifications
- Operating system : Linux
- Java version : 8
- Server version : git spigot 1.12.2 (API 1.12.2-R0.1-SNAPSHOT)
- ZHorse version : 1.6.8
- Database : mySql
Hi, the most recent version for Spigot 1.12.2 is ZHorse 1.7.0 (1.7.1 is for Spigot 1.13).
I suggest that you try it as it could fix your issue. If not, we will at least compare identical versions of the code.