This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
cherbert's profile picture

Error when booting up Command Computer - Command API not working

Started by cherbert, 25 February 2015 - 05:42 PM
cherbert #1
Posted 25 February 2015 - 06:42 PM
I am running Cauldron which is based on Forge 10.13.2.1231. I don't know if this is reasons for this problem but obvious reasons I cannot update to anything newer. I hope its something unrelated and can be fixed in an update as my server desperately needs the Bukkit capability of Cauldron.

I can place Command Computers but when I right click I see the error shown in the below screenshot. The error pasted below appears on the console.

I wrote a little line of code… commands.exec("Hello") which returns the following in the LUA editor.. Java Exception Thrown: java.lang.NoSuchMethodError:dan200.computercraft.api.lua.IluaContext.executeMainThreadTask(Ldan200/computercraft/api/lua/iLuaTask;)[Ljava/lang/Object;
>



[19:34:01 INFO]: ERROR
[19:34:01 INFO]: dan200.computercraft.api.lua.ILuaContext.executeMainThreadTask(Ldan200/computercraft/api/lua/ILuaTask;)[Ljava/lang/Object;
[19:34:01 INFO]: dan200.computercraft.shared.computer.apis.CommandAPI.callMethod(CommandAPI.java:147)
[19:34:01 INFO]: dan200.computercraft.core.lua.LuaJLuaMachine$2.invoke(LuaJLuaMachine.java:322)
[19:34:01 INFO]: org.luaj.vm2.lib.VarArgFunction.call(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaClosure.execute(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaClosure.onInvoke(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaClosure.invoke(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.lib.BaseLib.pcall(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.lib.BaseLib$BaseLibV.invoke(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaClosure.execute(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaClosure.call(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaClosure.execute(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaClosure.onInvoke(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaClosure.invoke(Unknown Source)
[19:34:01 INFO]: org.luaj.vm2.LuaThread$State.run(Unknown Source)
[19:34:01 INFO]: java.lang.Thread.run(Thread.java:745)

Lyqyd #2
Posted 25 February 2015 - 06:46 PM
Please provide a full mod list, including the version number of each mod.
cherbert #3
Posted 25 February 2015 - 06:59 PM
I removed all mods and put them back one by one. Seems ProjectRed is the problem. ProjectRed is not essential to me so I have removed it. I have replied with this info in case its something the dan wants to look into.
dan200 #4
Posted 25 February 2015 - 07:06 PM
Please post the entire crash log
Cranium #5
Posted 25 February 2015 - 09:13 PM
Another thing to point out, si that we'll need you to try the mod without Cauldron installed. Just plain forge, please.
Lyqyd #6
Posted 25 February 2015 - 10:18 PM
I removed all mods and put them back one by one. Seems ProjectRed is the problem. ProjectRed is not essential to me so I have removed it. I have replied with this info in case its something the dan wants to look into.

The information Dan requested is important to provide. If removing project red fixed it, were you using the latest available version of it? Some versions of that mod were known to replace the CC API and cause crashes.
theoriginalbit #7
Posted 26 February 2015 - 12:36 AM
Please post the entire crash log

I would hazard a guess that cherbert is using CC 1.7, because you have a problem with your CC 1.7 @API annotations.

For future reference, when you make new "full" versions, append a '0' to the end, so make it "1.X0" instead of "1.X". Reference them on the site as "1.X" as much as you want, but it has to be "1.X0" inside your @Mod, @API, and mcmod.info because Forge sees the version "1.64" and thinks it is newer than "1.7"—because 64 is larger than 7— and will replace your API when people bundle it (which ProjectRed does). The same goes for dependencies which is why the @Mod and mcmod.info need to be set this way also, because if I set the dependency of my mod to required-after:ComputerCraft@[1.64,); it will work for versions 1.64, 1.65, 1.71, and 1.72, but the second it sees 1.7 it will think it is an older version and not allow Minecraft to continue booting.
Edited on 25 February 2015 - 11:36 PM
dan200 #8
Posted 26 February 2015 - 11:07 AM
This is a valid theory, but based on no data (although: notice that his game *did* boot). Can somebody confirm that this bug does or doesn't happen in CC 1.71 or newer? My personal theory is that Project:Red is doing something weird that makes it ignore @API annotations.
cherbert #9
Posted 26 February 2015 - 11:53 AM
This is a valid theory, but based on no data (although: notice that his game *did* boot). Can somebody confirm that this bug does or doesn't happen in CC 1.71 or newer? My personal theory is that Project:Red is doing something weird that makes it ignore @API annotations.

I am actually using 1.73

Regarding Project Red… removing it hasn't actually fixed it. It does stop the Java Exception errors etc.. Everything appears to load up. Can place Command Computers and access their terminal. All without any in-game or server console errors/complaints.

However.. None of the commands I ask it to issue do anything. A simple commands.exec("say @p Hello") just gets ignored. The program runs without error but nothing happens.

I do appreciate you don't support Cauldron. I am still performing my own tests to try and pin it down and will get back to you if I learn anything else.
theoriginalbit #10
Posted 26 February 2015 - 12:03 PM
This is a valid theory, but based on no data (although: notice that his game *did* boot)
Well ProjectRed doesn't have ComputerCraft as a dependency so there'd be no reason for it to crash. In fact after I removed the dependency line from my own mod it continued to boot fine in my dev env even though an old API was being injected; simply because the only class that is removed from the class path is the ILuaTask as the others just had changes to the JavaDoc and thus no adverse effects.
dan200 #11
Posted 26 February 2015 - 12:05 PM
Have confirmed that this bug happens in ComputerCraft 1.73 with latest Project:Red Compat. Seems like Project:Red is ignoring @API annotations somehow, going to send them a bug report.
dan200 #12
Posted 26 February 2015 - 12:11 PM
Update: I have reported the bug here: https://github.com/MrTJP/ProjectRed/issues/728