Jump to content

gwideman

Members
  • Posts

    2
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

gwideman's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks, that was helpful. But if that's the case, then is it the case that, having given an "Id" value to the Item constructor, the mod code is never supposed to use that "Id" value again, but instead get itemID back from the Item if it's needed later? -- Graham
  2. 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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.