CommandHelper

CommandHelper

46.5k Downloads

Event location prefilter giving a stacktrace when 'world' is omitted.

LadyCailinBot opened this issue ยท 2 comments

commented

CMDHELPER-2835 - Reported by CyaNox

The following code:

bind(pressure_plate_activated, null, array('location': array(-14, 72, -1), @e,
  #...
)

Produces the following trace:

[02:25:41 ERROR]: Could not pass event PlayerInteractEvent to CommandHelper v3.3.1-SNAPSHOT:2447-fcc78ce,master
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) ~[Spigot.jar:git-Spigot-1158]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Spigot.jar:git-Spigot-1158]
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30) ~[Spigot.jar:git-Spigot-1158]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478) [Spigot.jar:git-Spigot-1158]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463) [Spigot.jar:git-Spigot-1158]
        at org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:208) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.BlockPressurePlateBinary.e(BlockPressurePlateBinary.java:53) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.BlockPressurePlateAbstract.a(BlockPressurePlateAbstract.java:92) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.BlockPressurePlateAbstract.a(BlockPressurePlateAbstract.java:86) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.Entity.I(Entity.java:773) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.Entity.move(Entity.java:428) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityLiving.e(EntityLiving.java:1210) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityHuman.e(EntityHuman.java:1260) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityLiving.e(EntityLiving.java:1466) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityHuman.e(EntityHuman.java:395) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityLiving.h(EntityLiving.java:1299) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityHuman.h(EntityHuman.java:162) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityPlayer.i(EntityPlayer.java:256) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java:339) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.PacketPlayInFlying.a(SourceFile:137) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.PacketPlayInPositionLook.handle(SourceFile:20) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:146) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:641) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:259) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:524) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:436) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [Spigot.jar:git-Spigot-1158]
Caused by: com.laytonsmith.core.exceptions.ConfigRuntimeException: The specified world doesn't exist, or no world was provided
        at com.laytonsmith.core.ObjectGenerator.location(ObjectGenerator.java:166) ~[?:?]
        at com.laytonsmith.core.events.Prefilters.LocationMatch(Prefilters.java:153) ~[?:?]
        at com.laytonsmith.core.events.Prefilters.match(Prefilters.java:124) ~[?:?]
        at com.laytonsmith.core.events.Prefilters.match(Prefilters.java:90) ~[?:?]
        at com.laytonsmith.core.events.drivers.PlayerEvents$pressure_plate_activated.matches(PlayerEvents.java:883) ~[?:?]
        at com.laytonsmith.core.events.EventUtils.GetMatchingEvents(EventUtils.java:173) ~[?:?]
        at com.laytonsmith.core.events.EventUtils.TriggerListener(EventUtils.java:193) ~[?:?]
        at com.laytonsmith.abstraction.bukkit.events.drivers.BukkitPlayerListener.onPlayerInteract(BukkitPlayerListener.java:74) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_25]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_25]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ~[Spigot.jar:git-Spigot-1158]
        ... 27 more

I think this could be handled more cleanly ;)

commented

Comment by CyaNox

Looks like prefilters barf similar errors on any invalid data:

[05:26:21 ERROR]: Could not pass event PlayerInteractEvent to CommandHelper v3.3.1-SNAPSHOT:2447-fcc78ce,master
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) ~[Spigot.jar:git-Spigot-1158]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Spigot.jar:git-Spigot-1158]
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30) ~[Spigot.jar:git-Spigot-1158]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478) [Spigot.jar:git-Spigot-1158]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463) [Spigot.jar:git-Spigot-1158]
        at org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:208) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.BlockPressurePlateBinary.e(BlockPressurePlateBinary.java:53) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.BlockPressurePlateAbstract.a(BlockPressurePlateAbstract.java:92) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.BlockPressurePlateAbstract.a(BlockPressurePlateAbstract.java:86) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.Entity.I(Entity.java:773) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.Entity.move(Entity.java:428) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityLiving.e(EntityLiving.java:1210) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityHuman.e(EntityHuman.java:1260) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityLiving.e(EntityLiving.java:1466) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityHuman.e(EntityHuman.java:395) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityLiving.h(EntityLiving.java:1299) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityHuman.h(EntityHuman.java:162) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.EntityPlayer.i(EntityPlayer.java:256) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java:339) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.PacketPlayInFlying.a(SourceFile:137) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.PacketPlayInPosition.handle(SourceFile:63) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:146) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:641) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:259) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:524) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:436) [Spigot.jar:git-Spigot-1158]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [Spigot.jar:git-Spigot-1158]
Caused by: com.laytonsmith.core.exceptions.ConfigRuntimeException: Expecting an array, received STRING
        at com.laytonsmith.core.ObjectGenerator.location(ObjectGenerator.java:106) ~[?:?]
        at com.laytonsmith.core.events.Prefilters.LocationMatch(Prefilters.java:153) ~[?:?]
        at com.laytonsmith.core.events.Prefilters.match(Prefilters.java:124) ~[?:?]
        at com.laytonsmith.core.events.Prefilters.match(Prefilters.java:90) ~[?:?]
        at com.laytonsmith.core.events.drivers.PlayerEvents$pressure_plate_activated.matches(PlayerEvents.java:883) ~[?:?]
        at com.laytonsmith.core.events.EventUtils.GetMatchingEvents(EventUtils.java:173) ~[?:?]
        at com.laytonsmith.core.events.EventUtils.TriggerListener(EventUtils.java:193) ~[?:?]
        at com.laytonsmith.abstraction.bukkit.events.drivers.BukkitPlayerListener.onPlayerInteract(BukkitPlayerListener.java:74) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_25]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_25]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ~[Spigot.jar:git-Spigot-1158]
        ... 27 more
commented

Comment by LadyCailin

This should be fixed now. It will throw a proper mscript exception, as expected.