CommandHelper

CommandHelper

46.5k Downloads

FallingBlock Entities

LadyCailinBot opened this issue ยท 8 comments

commented

CMDHELPER-3064 - Reported by PseudoKnight

[05:29:30] [Server thread/ERROR]: Could not pass event PlayerInteractEntityEvent to CommandHelper v3.3.1-SNAPSHOT.2875-
org.bukkit.event.EventException
	at com.laytonsmith.commandhelper.CommandHelperPlugin$8.execute(CommandHelperPlugin.java:501) ~[?:?]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-1d14d5f-7722428]
	at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:36) ~[spigot.jar:git-Spigot-1d14d5f-7722428]
	at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java:1305) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at net.minecraft.server.v1_8_R2.PacketPlayInUseEntity.a(SourceFile:52) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at net.minecraft.server.v1_8_R2.PacketPlayInUseEntity.a(SourceFile:11) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at net.minecraft.server.v1_8_R2.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0]
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [?:1.7.0]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.7.0]
	at net.minecraft.server.v1_8_R2.SystemUtils.a(SourceFile:60) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:710) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:368) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:651) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:554) [spigot.jar:git-Spigot-1d14d5f-7722428]
	at java.lang.Thread.run(Unknown Source) [?:1.7.0]
Caused by: com.laytonsmith.PureUtilities.Common.ReflectionUtils$ReflectionException: java.lang.NoSuchMethodException: com.laytonsmith.abstraction.bukkit.blocks.BukkitMCFallingBlock.<init>(org.bukkit.entity.Entity)
	at com.laytonsmith.PureUtilities.Common.ReflectionUtils.newInstance(ReflectionUtils.java:74) ~[?:?]
	at com.laytonsmith.abstraction.bukkit.BukkitConvertor.BukkitGetCorrectEntity(BukkitConvertor.java:311) ~[?:?]
	at com.laytonsmith.abstraction.bukkit.events.BukkitEntityEvents$BukkitMCPlayerInteractEntityEvent.getEntity(BukkitEntityEvents.java:398) ~[?:?]
	at com.laytonsmith.core.events.drivers.EntityEvents$player_interact_entity.matches(EntityEvents.java:828) ~[?:?]
	at com.laytonsmith.core.events.EventUtils.GetMatchingEvents(EventUtils.java:207) ~[?:?]
	at com.laytonsmith.core.events.EventUtils.TriggerListener(EventUtils.java:241) ~[?:?]
	at com.laytonsmith.abstraction.bukkit.events.drivers.BukkitEntityListener.onClickEnt(BukkitEntityListener.java:49) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0]
	at com.laytonsmith.commandhelper.CommandHelperPlugin$8.execute(CommandHelperPlugin.java:499) ~[?:?]
	... 17 more
Caused by: java.lang.NoSuchMethodException: com.laytonsmith.abstraction.bukkit.blocks.BukkitMCFallingBlock.<init>(org.bukkit.entity.Entity)
	at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.7.0]
	at java.lang.Class.getDeclaredConstructor(Unknown Source) ~[?:1.7.0]
	at com.laytonsmith.PureUtilities.Common.ReflectionUtils.newInstance(ReflectionUtils.java:70) ~[?:?]
	at com.laytonsmith.abstraction.bukkit.BukkitConvertor.BukkitGetCorrectEntity(BukkitConvertor.java:311) ~[?:?]
	at com.laytonsmith.abstraction.bukkit.events.BukkitEntityEvents$BukkitMCPlayerInteractEntityEvent.getEntity(BukkitEntityEvents.java:398) ~[?:?]
	at com.laytonsmith.core.events.drivers.EntityEvents$player_interact_entity.matches(EntityEvents.java:828) ~[?:?]
	at com.laytonsmith.core.events.EventUtils.GetMatchingEvents(EventUtils.java:207) ~[?:?]
	at com.laytonsmith.core.events.EventUtils.TriggerListener(EventUtils.java:241) ~[?:?]
	at com.laytonsmith.abstraction.bukkit.events.drivers.BukkitEntityListener.onClickEnt(BukkitEntityListener.java:49) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0]
	at com.laytonsmith.commandhelper.CommandHelperPlugin$8.execute(CommandHelperPlugin.java:499) ~[?:?]
	... 17 more
commented

Comment by Pieter12345

Are you able to reproduce the bug? I'm running the same CH version on CraftBukkit 1.8.3_R0.1 and I'm not receiving errors when interacting with falling blocks.

commented

Comment by PseudoKnight

I never tried. I only saw it once (though it did the same stacktrace for both EntityInteract and EntityInteractAt). The stacktrace seems pretty obviously a right click on a falling block entity. I wasn't aware that caused an interact event, though. It's possible it's detecting the wrong type of entity due to the recent changes. I haven't traversed the new code yet to see if that's possible. Either way, this is all I have.

For what it's worth, I built Spigot 25 hours ago. I updated past CH build 2859 at the same time, so it'd be surprising to me that no one else encountered this, considering it was less than a day of using the build.

commented

Comment by PseudoKnight

It happened again, plus I got a new Core error with Falling Block entities.

[16:41:47] [Server thread/ERROR]: Uh oh! You've found an error in Core.
This is an error caused while running your code, so you may be able to find a workaround, but is ultimately an error in Core itself.
The line of code that caused the error was this:
@entity = 173408
entity_type(@entity)
on or around E:\UserFiles\SCOTTD\GameServers\TC14642002878638805731123\Minecraft\plugins\CommandHelper\LocalPackages\finalscore\auto_include.ms:315.
Please report this error to the developers, and be sure to include the version numbers:
Server version: 1.8.3-R0.1-SNAPSHOT;
CommandHelper version: 3.3.1-SNAPSHOT.2875-;
Loaded extensions and versions:
CHNaughty (version 1.8.3);
CHVirtualChests (version 1.0.3);
CHSpigot (version 1.3.0);
CHStargate (version 1.0.1);
SKCompat (version 1.1.7);
Core (version 3.3.1);
CHDynmap (version 1.1.1);
Here's the stacktrace:
com.laytonsmith.PureUtilities.Common.ReflectionUtils$ReflectionException: java.lang.NoSuchMethodException: com.laytonsmith.abstraction.bukkit.blocks.BukkitMCFallingBlock.<init>(org.bukkit.entity.Entity)
	at com.laytonsmith.PureUtilities.Common.ReflectionUtils.newInstance(ReflectionUtils.java:74)
	at com.laytonsmith.abstraction.bukkit.BukkitConvertor.BukkitGetCorrectEntity(BukkitConvertor.java:311)
	at com.laytonsmith.abstraction.bukkit.BukkitConvertor.GetCorrectEntity(BukkitConvertor.java:363)
	at com.laytonsmith.abstraction.StaticLayer.GetCorrectEntity(StaticLayer.java:160)
	at com.laytonsmith.core.Static.getEntity(Static.java:803)
	at com.laytonsmith.core.functions.EntityManagement$entity_type.exec(EntityManagement.java:495)
	at com.laytonsmith.core.Script.eval(Script.java:353)
	at com.laytonsmith.core.Script.eval(Script.java:322)
	at com.laytonsmith.core.Script.eval(Script.java:322)
	at com.laytonsmith.core.functions.DataHandling$foreach.execs(DataHandling.java:737)
	at com.laytonsmith.core.Script.eval(Script.java:312)
	at com.laytonsmith.core.Script.eval(Script.java:322)
	at com.laytonsmith.core.functions.DataHandling$forelse.execs(DataHandling.java:550)
	at com.laytonsmith.core.functions.DataHandling$_for.execs(DataHandling.java:397)
	at com.laytonsmith.core.Script.eval(Script.java:312)
	at com.laytonsmith.core.Script.eval(Script.java:322)
	at com.laytonsmith.core.functions.DataHandling$forelse.execs(DataHandling.java:550)
	at com.laytonsmith.core.functions.DataHandling$_for.execs(DataHandling.java:397)
	at com.laytonsmith.core.Script.eval(Script.java:312)
	at com.laytonsmith.core.Procedure.execute(Procedure.java:214)
	at com.laytonsmith.core.Procedure.cexecute(Procedure.java:165)
	at com.laytonsmith.core.Script.eval(Script.java:281)
	at com.laytonsmith.core.Script.eval(Script.java:322)
	at com.laytonsmith.core.Script.seval(Script.java:240)
	at com.laytonsmith.core.functions.BasicLogic$_switch.execs(BasicLogic.java:414)
	at com.laytonsmith.core.Script.eval(Script.java:312)
	at com.laytonsmith.core.Script.seval(Script.java:240)
	at com.laytonsmith.core.functions.BasicLogic$_switch.execs(BasicLogic.java:414)
	at com.laytonsmith.core.Script.eval(Script.java:312)
	at com.laytonsmith.core.Procedure.execute(Procedure.java:217)
	at com.laytonsmith.core.Procedure.cexecute(Procedure.java:165)
	at com.laytonsmith.core.Script.eval(Script.java:281)
	at com.laytonsmith.core.Script.eval(Script.java:322)
	at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1908)
	at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1865)
	at com.laytonsmith.core.constructs.CClosure.execute(CClosure.java:179)
	at com.laytonsmith.core.functions.ExecutionQueue$queue_push$1$1.call(ExecutionQueue.java:76)
	at org.bukkit.craftbukkit.v1_8_R2.scheduler.CraftFuture.run(CraftFuture.java:89)
	at org.bukkit.craftbukkit.v1_8_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
	at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:718)
	at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:368)
	at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:651)
	at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:554)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodException: com.laytonsmith.abstraction.bukkit.blocks.BukkitMCFallingBlock.<init>(org.bukkit.entity.Entity)
	at java.lang.Class.getConstructor0(Unknown Source)
	at java.lang.Class.getDeclaredConstructor(Unknown Source)
	at com.laytonsmith.PureUtilities.Common.ReflectionUtils.newInstance(ReflectionUtils.java:70)
	... 43 more

This time I could figure out what was causing it: a falling enderdragon egg, which it does for a second after it teleports. This breaks one of my minigames, so I'm raising the priority.

commented

Comment by Pieter12345

Hmh, so this call is invalid:
new com.laytonsmith.abstraction.bukkit.blocks.BukkitMCFallingBlock(org.bukkit.entity.Entity)

It should be called with org.bukkit.entity.FallingBlock instead.

I'm assuming that "Entity.class" should be "FallingBlock.class" in this case in BukkitConvertor.java:311:
return ReflectionUtils.newInstance(clazz, new Class[]{Entity.class}, new Object[]{be});

I'm not able to reproduce the bug, but this might solve it:
Replace BukkitConverter.java:310-312:
if (clazz != null) {
return ReflectionUtils.newInstance(clazz, new Class[]{Entity.class}, new Object[]{be});
}
by:
if (clazz != null) {
if(clazz == com.laytonsmith.abstraction.bukkit.blocks.BukkitMCFallingBlock.class) {
return ReflectionUtils.newInstance(clazz,
new Class[]{org.bukkit.entity.FallingBlock.class}, new Object[]{be});
} else {
return ReflectionUtils.newInstance(clazz, new Class[]{Entity.class}, new Object[]{be});
}
}

Hope it helps, I have no idea why I'm not able to reproduce it though.

commented

Comment by PseudoKnight

Increasing this to Major as it's breaking more things. I have a game that detects falling sand creation with entity_change_block and all it does is try to remove the falling block. Now it causes a core error. I can disable that for now but my entity clean-up script chokes on these entities, and all I can do is push it to the end of my script so it doesn't completely break everything.

commented

Comment by PseudoKnight

Just found out that the original core error is occurring when a player drops sand/gravel.

commented

Comment by PseudoKnight

Is no one else getting this? I just got spammed with over 43,000 lines of errors in my latest log from I think ONE player over the course of an hour and 35 minutes. lol

commented

Comment by PseudoKnight

Went ahead and looked into it myself as jb-aero seems busy.
#301