ScriptCraft icon indicating copy to clipboard operation
ScriptCraft copied to clipboard

Cannot cast java.lang.Double

Open gregja opened this issue 4 years ago • 9 comments

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.

gregja avatar Mar 29 '20 09:03 gregja

Do you have more details about this error ?, I just tried this on my server and it seems to work properly without any exceptions

TzunamiDev avatar Mar 31 '20 12:03 TzunamiDev

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

wwlib avatar Apr 02 '20 17:04 wwlib

See this issue: https://github.com/walterhiggins/ScriptCraft/issues/401

Drone doesn't work with 1.15.2

jwulf avatar Apr 03 '20 09:04 jwulf

Thanks for the reply.

Is there an alternative to CraftEvil - or another way to place blocks?

wwlib avatar Apr 03 '20 14:04 wwlib

I just cloned MagikCraft and like the npm-style setup. Happy to help if there is a way to get Drone working again.

wwlib avatar Apr 03 '20 15:04 wwlib

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!

jwulf avatar Apr 04 '20 07:04 jwulf

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.)

wwlib avatar Apr 07 '20 01:04 wwlib

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

jwulf avatar Apr 07 '20 02:04 jwulf

So summary here is ScriptCraft for MC version 1.15.2 and newer will not work due to the dependency Drone and CraftEvil?

justinchin919 avatar Jun 26 '20 21:06 justinchin919