TreeAssist icon indicating copy to clipboard operation
TreeAssist copied to clipboard

org.bukkit.material.MaterialData cannot be cast to org.bukkit.material.Tree

Open bog500 opened this issue 10 years ago • 7 comments

Got this error today. I can't give more details, I'm not the player who generated it.

[21:37:31] [Server thread/WARN]: [TreeAssist] Task #65300 for TreeAssist v5.8.89 generated an exception java.lang.ClassCastException: org.bukkit.material.MaterialData cannot be cast to org.bukkit.material.Tree at me.itsatacoshop247.TreeAssist.TreeAssistReplant.run(TreeAssistReplant.java:42) ~[?:?] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at java.lang.Thread.run(Unknown Source) [?:1.8.0_60]

bog500 avatar Dec 07 '15 02:12 bog500

hmmm maybe they broke something? Try running the purge command, it removes invalid "no more logs", maybe you have used worldedit and the plugin thinks there are logs where there are no logs atm?

slipcor avatar Dec 17 '15 00:12 slipcor

Worldedit is not installed on this server. nor any other plugin that use the axe as a special tool.

bog500 avatar Dec 17 '15 14:12 bog500

Hm yeah I was not talking about the tool part, but rather about "something" removing logs while the plugin didnt notice (and thus not clean up) :)

try

/treeassist purge [worldname]

or

/treeassist purge global

slipcor avatar Dec 17 '15 23:12 slipcor

Ok, well no I don't have any plugin that would do that either.

It only happened once. Could it be because two persons were cutting the same log at the same time ?

bog500 avatar Dec 18 '15 14:12 bog500

Hmm technically, yes! But there are so many plugins that might have altered blocks, so just doing this command every now and then will not hurt :)

After all, MY plugin could actually MISS legit block removals for whatever reasons and that could cause this NPE too :) no system is flawless ;)

slipcor avatar Dec 18 '15 18:12 slipcor

We use Worldedit and get the same messages, cause a bit of lag when this happens... 18.06 14:51:54 [Server] WARN [TreeAssist] Task #3798 for TreeAssist v5.8.89 generated an exception 18.06 14:51:54 [Server] INFO java.lang.ClassCastException: org.bukkit.material.Sapling cannot be cast to org.bukkit.material.Tree 18.06 14:51:54 [Server] INFO at me.itsatacoshop247.TreeAssist.TreeAssistReplant.run(TreeAssistReplant.java:42) ~[?:?] 18.06 14:51:54 [Server] INFO at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot-latest.jar:git-Spigot-c55900f-9856d8a] 18.06 14:51:54 [Server] INFO at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [spigot-latest.jar:git-Spigot-c55900f-9856d8a] 18.06 14:51:54 [Server] INFO at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:741) [spigot-latest.jar:git-Spigot-c55900f-9856d8a] 18.06 14:51:54 [Server] INFO at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:399) [spigot-latest.jar:git-Spigot-c55900f-9856d8a] 18.06 14:51:54 [Server] INFO at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:672) [spigot-latest.jar:git-Spigot-c55900f-9856d8a] 18.06 14:51:54 [Server] INFO at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:571) [spigot-latest.jar:git-Spigot-c55900f-9856d8a] 18.06 14:51:54 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92]

could the the warn be from a minor change in bukkit?

Fam-of3 avatar Jun 18 '16 18:06 Fam-of3

I have moved to https://github.com/slipcor/TreeAssist

and furthermore, especially for Spigot, to the spigot page:

https://www.spigotmc.org/resources/treeassist.16941/

slipcor avatar Jun 18 '16 19:06 slipcor