Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/02/17 in all areas

  1. Not to mention, Items are Singletons. There exists only 1 of each item. Any data stored in the Item class, will be global for each ItemStack containing said Item. The way you intend to work using this SelfStack will thus not work. You are given the correct ItemStack in almost all possible method parameters (here, it's par1ItemStack¹), either directly, or if need ever be, through the EntityPlayer. ¹Please edit your parameter names as well. par1, par2...par27 looks horrible and are easily mistaken for each other by the human eye.
    1 point
  2. What is SelfStack, where are you getting that from? If you want to add information based on the NBT of the stack in question, you need to get the NBT from the stack in question - the one the method gives you.
    1 point
  3. In addition to ItemStack#setCount, you can also use ItemStack#grow and ItemStack#shrink.
    1 point
  4. You can use getCount() to get stack size or setCount() to set stackSize. The stackSize is private because ItemStack in forge 1.11.2 is never null. You should use ItemStack.EMPTY instead of null!
    1 point
×
×
  • Create New...

Important Information

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