TriggerReactor

TriggerReactor

24.6k Downloads

io.github.wysohn.triggerreactor.core.script.wrapper.Accessor cast issue

rkdrns4747 opened this issue ยท 1 comments

commented

Some values cannot be handled with TriggerReactor local variable. (ex. long value)
Here's my code:

IMPORT java.lang.Long
id = Long.valueOf(args[0]).longValue() //args[0] has 18-digit number in String

Throws

[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.manager.trigger.Trigger.start(Trigger.java:279)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.manager.trigger.Trigger$1.call(Trigger.java:230)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.manager.trigger.Trigger$1.call(Trigger.java:226)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.manager.trigger.Trigger.startInterpretation(Trigger.java:242)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.manager.trigger.Trigger.activate(Trigger.java:172)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.bukkit.manager.trigger.CommandTriggerManager.execute(CommandTriggerManager.java:220)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.bukkit.manager.trigger.CommandTriggerManager.lambda$registerCommand$6(CommandTriggerManager.java:158)
[00:15:13] [Server thread/WARN]: 	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[00:15:13] [Server thread/WARN]: 	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149)
[00:15:13] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:711)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.PlayerConnection.handleCommand(PlayerConnection.java:1657)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1497)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:47)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(SourceFile:144)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(SourceFile:118)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:918)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:911)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:895)
[00:15:13] [Server thread/WARN]: 	at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:828)
[00:15:13] [Server thread/WARN]: 	at java.lang.Thread.run(Unknown Source)
[00:15:13] [Server thread/WARN]: Caused by: io.github.wysohn.triggerreactor.core.script.interpreter.InterpreterException: Error at row[18], col[28]
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.interpret(Interpreter.java:925)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:487)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:449)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:449)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:449)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:210)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:449)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:228)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.startWithContextAndInterrupter(Interpreter.java:199)
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.manager.trigger.Trigger.start(Trigger.java:275)
[00:15:13] [Server thread/WARN]: 	... 24 more
[00:15:13] [Server thread/WARN]: Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to io.github.wysohn.triggerreactor.core.script.wrapper.Accessor
[00:15:13] [Server thread/WARN]: 	at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.interpret(Interpreter.java:816)
[00:15:13] [Server thread/WARN]: 	... 33 more
commented

someString.split(" ")[0] would cause cast exception