Hi folks. Using MC 1.4.6 and current MCP and Forge, I've been working through the tutorials on this site (for example, Basic Blocks, and Plants), and I run into code that uses the itemID field of objects that are descendants of Item. Examples:
[pre]public int idDropped(int par1, Random random, int par2) {
return BasicBlockMod.basicIngot.itemID;
[/pre]
and
[pre]public int idPicked (World world, int x, int y, int z) {
return BasicPlantMod.tomatoSeeds.itemID;
[/pre]
These samples expect Item to have the field itemID, but it does not -- perhaps it's a field that's been removed? I'm guessing that itemID used to be set by the int value supplied in the Item constructor -- however that now does this:
[pre] public Item(int par1) {
this.shiftedIndex = 256 + par1;[/pre]
So, conceptually, Item's memory of an id is in shiftedIndex. But because shiftedIndex is off by 256 from the originally-supplied Id value, it's not clear what the intent is here when an ID needs to be used in, or returned from, other functions.
What should code like idDropped and idPicked be returning? shiftIndex? shiftIndex-256? Something else? How is this used elsewhere?
Thanks,
Graham