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

(Solved)Computercraft API not registering turtle upgrades

Started by Konlab, 18 March 2016 - 03:26 PM
Konlab #1
Posted 18 March 2016 - 04:26 PM
I am trying to create a turtle upgrade, but it doesn't work:
Here are the neccessary files:
http://pastebin.com/N0jZ8xRE - the class that is registering the turtle upgrades, yes it is called, I debugged it (crashes at line 21 because of debugging, NullPointerException), because the turtle upgrade is not registered (without line 21 of course it runs but when I try to craft upgraded turtle/equip item it does nothing/ says item is not equippable)
http://pastebin.com/QRKEHNhM - the ITurtleUpgrade, the debug at line 28 is successfully output to the console.

Edit: solved, it seems that the integer id was not enough, a resourcelocation id was neccessary too
Edited on 23 March 2016 - 01:06 PM
Engineer #2
Posted 20 March 2016 - 12:28 PM
I'm not that familiar with the API anymore, but posting the error stacktrace always is must-do with errors, simply because it is not clear what the exact issue is. A nullpointer could be anywhere :P/>/>
Edited on 20 March 2016 - 11:36 AM
Konlab #3
Posted 20 March 2016 - 01:03 PM
Sorry for not being clear.
The exception is not happenning normally, only when I try to access my turtle uprade from dan200.computercraft.ComputerCraft, and it is because the getturtleupgradebyid returns null when it should return my upgrade.

Edit: http://pastebin.com/QzdP3xWT - is the stacktrace if it does help
Edited on 20 March 2016 - 12:16 PM