a problem with the Vector constructor
305pence opened this issue ยท 3 comments
so, basically i needed to make a vector at some point, but it doesn't accept any numbers that aren't integers even though it's supposed to
code:
IMPORT org.bukkit.util.Vector
v = Vector(4, 4, 2)
v2 = Vector(4.2, 4.4, 2.3)
#MESSAGE v + v2
error:
[21:07:23] [Server thread/INFO]: 30Spence issued server command: /trg run #CALL "sword2"
[21:07:23] [Server thread/WARN]: java.lang.Exception: Could not finish interpretation for [sword2]!
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager$Trigger.start(AbstractTriggerManager.java:409)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager$Trigger$1.call(AbstractTriggerManager.java:359)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager$Trigger$1.call(AbstractTriggerManager.java:355)
[21:07:23] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftFuture.run(CraftFuture.java:88)
[21:07:23] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:394)
[21:07:23] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.b(MinecraftServer.java:1022)
[21:07:23] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.DedicatedServer.b(DedicatedServer.java:393)
[21:07:23] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.a(MinecraftServer.java:970)
[21:07:23] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:815)
[21:07:23] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)
[21:07:23] [Server thread/WARN]: Caused by: io.github.wysohn.triggerreactor.core.script.interpreter.InterpreterException: Error at row[3], col[11]
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.interpret(Interpreter.java:921)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:483)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.start(Interpreter.java:445)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.startWithContextAndInterrupter(Interpreter.java:199)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.manager.trigger.AbstractTriggerManager$Trigger.start(AbstractTriggerManager.java:404)
[21:07:23] [Server thread/WARN]: ... 9 more
[21:07:23] [Server thread/WARN]: Caused by: io.github.wysohn.triggerreactor.core.script.interpreter.InterpreterException: Cannot create new instance with [type: OBJECT, value: 'Vector'] at row[3], col[11] of Vector
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.callFunction(Interpreter.java:975)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.interpret(Interpreter.java:796)
[21:07:23] [Server thread/WARN]: ... 13 more
[21:07:23] [Server thread/WARN]: Caused by: java.lang.IllegalArgumentException: argument type mismatch
[21:07:23] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[21:07:23] [Server thread/WARN]: at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[21:07:23] [Server thread/WARN]: at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[21:07:23] [Server thread/WARN]: at java.lang.reflect.Constructor.newInstance(Unknown Source)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.tools.ReflectionUtil.constructNew(ReflectionUtil.java:532)
[21:07:23] [Server thread/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.callFunction(Interpreter.java:973)
[21:07:23] [Server thread/WARN]: ... 14 more
This method wouldn't be located despite all of the parameters matches
Can it be because of the final modifier? Need some investigation.
[15:16:45] [pool-50-thread-9/WARN]: Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
[15:16:45] [pool-50-thread-9/WARN]: at io.github.wysohn.triggerreactor.tools.ReflectionUtil.buildFailMessage(ReflectionUtil.java:317)
[15:16:45] [pool-50-thread-9/WARN]: at io.github.wysohn.triggerreactor.tools.ReflectionUtil.invokeMethod(ReflectionUtil.java:277)
[15:16:45] [pool-50-thread-9/WARN]: at io.github.wysohn.triggerreactor.tools.ReflectionUtil.invokeMethod(ReflectionUtil.java:350)
[15:16:45] [pool-50-thread-9/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.callFunction(Interpreter.java:997)
[15:16:45] [pool-50-thread-9/WARN]: at io.github.wysohn.triggerreactor.core.script.interpreter.Interpreter.interpret(Interpreter.java:814)
[15:16:45] [pool-50-thread-9/WARN]: ... 9 more