WorldEdit

WorldEdit

43M Downloads

Craftscript error with ClassCastException

LadyCailinBot opened this issue ยท 1 comments

commented

WORLDEDIT-3309 - Reported by spaceribs

When running worldedit-forge-mc1.8-6.1 with nothing but the GUI installed with Litemod and Forge in Single Player, I tried running the following:

importPackage(Packages.java.io);

When running this simple script, I got this error back:

Jun 13, 2015 10:22:54 PM com.sk89q.worldedit.WorldEdit runScript
WARNING: [WorldEdit] Failed to execute script
java.lang.ClassCastException: org.mozilla.javascript.NativeJavaClass cannot be cast to org.mozilla.javascript.NativeJavaPackage
	at org.mozilla.javascript.NativeJavaTopPackage.init(NativeJavaTopPackage.java:96)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.mozilla.javascript.ScriptableObject.buildClassCtor(ScriptableObject.java:1309)
	at org.mozilla.javascript.LazilyLoadedCtor.buildValue0(LazilyLoadedCtor.java:105)
	at org.mozilla.javascript.LazilyLoadedCtor.access$000(LazilyLoadedCtor.java:18)
	at org.mozilla.javascript.LazilyLoadedCtor$1.run(LazilyLoadedCtor.java:90)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.mozilla.javascript.LazilyLoadedCtor.buildValue(LazilyLoadedCtor.java:86)
	at org.mozilla.javascript.LazilyLoadedCtor.init(LazilyLoadedCtor.java:66)
	at org.mozilla.javascript.ScriptableObject$GetterSlot.getValue(ScriptableObject.java:320)
	at org.mozilla.javascript.ScriptableObject.get(ScriptableObject.java:472)
	at org.mozilla.javascript.IdScriptableObject.get(IdScriptableObject.java:334)
	at org.mozilla.javascript.ImporterTopLevel.get(ImporterTopLevel.java:96)
	at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:2269)
	at org.mozilla.javascript.ScriptRuntime.topScopeName(ScriptRuntime.java:1945)
	at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1847)
	at org.mozilla.javascript.gen._Users_xxx_Library_Application_Support_minecraft_config_worldedit_craftscripts_maze_js_1._c_script_0(/Users/xxx/Library/Application Support/minecraft/config/worldedit/craftscripts/maze.js:19)
	at org.mozilla.javascript.gen._Users_xxx_Library_Application_Support_minecraft_config_worldedit_craftscripts_maze_js_1.call(/Users/xxx/Library/Application Support/minecraft/config/worldedit/craftscripts/maze.js)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
	at com.sk89q.worldedit.scripting.RhinoContextFactory.doTopCall(RhinoContextFactory.java:58)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3280)
	at org.mozilla.javascript.gen._Users_xxx_Library_Application_Support_minecraft_config_worldedit_craftscripts_maze_js_1.call(/Users/xxx/Library/Application Support/minecraft/config/worldedit/craftscripts/maze.js)
	at org.mozilla.javascript.gen._Users_xxx_Library_Application_Support_minecraft_config_worldedit_craftscripts_maze_js_1.exec(/Users/xxx/Library/Application Support/minecraft/config/worldedit/craftscripts/maze.js)
	at org.mozilla.javascript.Context.evaluateString(Context.java:1191)
	at com.sk89q.worldedit.scripting.RhinoCraftScriptEngine.evaluate(RhinoCraftScriptEngine.java:60)
	at com.sk89q.worldedit.WorldEdit.runScript(WorldEdit.java:761)
	at com.sk89q.worldedit.command.ScriptingCommands.execute(ScriptingCommands.java:78)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sk89q.worldedit.util.command.parametric.ParametricCallable.call(ParametricCallable.java:243)
	at com.sk89q.worldedit.util.command.SimpleDispatcher.call(SimpleDispatcher.java:125)
	at com.sk89q.worldedit.extension.platform.CommandManager.handleCommand(CommandManager.java:225)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sk89q.worldedit.util.eventbus.MethodEventHandler.dispatch(MethodEventHandler.java:58)
	at com.sk89q.worldedit.util.eventbus.EventHandler.handleEvent(EventHandler.java:73)
	at com.sk89q.worldedit.util.eventbus.EventBus.dispatch(EventBus.java:187)
	at com.sk89q.worldedit.util.eventbus.EventBus.post(EventBus.java:173)
	at com.sk89q.worldedit.forge.ForgeWorldEdit.onCommandEvent(ForgeWorldEdit.java:141)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_8_ForgeWorldEdit_onCommandEvent_CommandEvent.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138)
	at net.minecraft.command.CommandHandler.func_71556_a(CommandHandler.java:52)
	at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:812)
	at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:791)
	at net.minecraft.network.play.client.C01PacketChatMessage.func_180757_a(SourceFile:37)
	at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9)
	at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:714)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:656)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:598)
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:164)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478)
	at java.lang.Thread.run(Thread.java:695)

I am using Rhino 1.7.6, and it's placed alongside my other mods in the mods/1.8 folder.

commented

Comment by spaceribs

Verified working in 1.7.10