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

Peripheral Api Issue - Turtle Upgrade Id 32767 Fails Silently?

Started by GopherAtl, 06 August 2013 - 11:02 AM
GopherAtl #1
Posted 06 August 2013 - 01:02 PM
Working on a new mod, while testing I had my turtle upgrade class returning 32767 for getUpgradeID(), and the turtle was not craftable.

Changed it to 32766, and now it works fine.

When returning 32767, registerTurtleUpgrade didn't throw an exception (which the documentation says it would, if it's in use or reserved), or show any error message in the logs, but it isn't craftable in-game, either.

Pretty minor thing, but figured I'd report it anyway. I figured out that was the problem pretty quickly, but others might not be so lucky and do much head-scratching over why it isn't working!
exploder #2
Posted 09 August 2013 - 05:08 AM
Well I guess the problem could be because 32767 is the max size of short data type in Java? If you look at this side then you'll see that short min and max values are exactly -32767 and 32767 (assuming that CC uses short data type for IDs). But I might not be 100% sure.

Site: http://www.tutorials...c_datatypes.htm
immibis #3
Posted 11 August 2013 - 08:38 AM
Why would that be it? The maximum is 32767, so 32767 is still a valid value.

The minimum value is -32768, btw.
exploder #4
Posted 11 August 2013 - 01:31 PM
Why would that be it? The maximum is 32767, so 32767 is still a valid value.

The minimum value is -32768, btw.

I though about that too but as I said in last post is that i'm not 100% sure.