ScriptCraft
ScriptCraft copied to clipboard
Cannot cast java.lang.Double
Hi, I hope that everybody here is in good health. I met a bug with the drone object. My config is :
Scriptcraft on Fedora 29.
JDK 1.8.0-232 (wich includes Nashorn)
Spigot-1.15.2
MagicCraft (as recommended in that issue #437)
The error is :
xxx issued server command: /js drone.box(blocks.rainbow[1]) [10:48:03 INFO]: [scriptcraft] Drone build error: java.lang.ClassCastException: Cannot cast java.lang.Double to org.bukkit.block.data.BlockData while processing function wrapperFn() { [native code] }
Simple commands like "/js var drone = new Drone(self)" seems to work fine. Is is due to something wrong in my configuration ? Thank's for you help. Take care.
Do you have more details about this error ?, I just tried this on my server and it seems to work properly without any exceptions
I am seeing the same errors after installing a scriptcraft.jar that I just built from the latest development commit:
commit 6f5771d4c842ea86143ae5d5c9e022292bcd0de6
Merge: dae0f9d 24568fd
Author: Walter Higgins <[email protected]>
Date: Tue Feb 4 14:42:45 2020 +0000
Merge pull request #434 from jwulf/patch-4
Gracefully fail drone module on 1.15.2+
[scriptcraft] Drone build error: java.lang.ClassCastException: Cannot cast java.lang.Integer to org.bukkit.block.data.BlockData while processing function wrapperFn() { [native code] }
[scriptcraft] Drone build error: java.lang.ClassCastException: Cannot cast java.lang.Double to org.bukkit.block.data.BlockData while processing function wrapperFn() { [native code] }
I am running spigot.1.15.2.jar
Note: I updates build.xml to target 1.8 vs 1.6
<javac includeantruntime="false"
source="1.8"
target="1.8"
destdir="${build}"
debug="true">
java version "1.8.0_131"
Andrew
See this issue: https://github.com/walterhiggins/ScriptCraft/issues/401
Drone doesn't work with 1.15.2
Thanks for the reply.
Is there an alternative to CraftEvil - or another way to place blocks?
I just cloned MagikCraft and like the npm-style setup. Happy to help if there is a way to get Drone working again.
Great - you are basically where everyone else is with it. It doesn't work, and we need to find a new way to implement it.
I don't use it, so I don't have a motivation to spend time in there figuring it out. If it's your jam, and you can do it - that would be awesome!
I will give it a shot. If there is someone who would be willing to chat for a few minutes (discord?) about the most relevant background that would be great. Maybe a spigot developer who is familiar with ScriptCraft/MagikCraft? (I am new to this community.)
I'm familiar with ScriptCraft and MagikCraft, but not with this particular aspect of Spigot (which is why it is not a low-orbit task for me). Happy to chat on Discord.
Link expires in 1 day: https://discord.gg/v5epMc
So summary here is ScriptCraft for MC version 1.15.2 and newer will not work due to the dependency Drone and CraftEvil?