jopi
Попрошайка
- 1,421
- 30
- 260
Java:
public class ItemMulti extends Item {
public int count;
public ItemMulti(int id, int count, String unlocalizedName) {
super(id);
this.count = count;
this.setHasSubtypes(true);
this.setUnlocalizedName(unlocalizedName);
this.setCreativeTab(ItemHandler.tabItems);
this.setMaxStackSize(99);
this.setMaxDamage(0);
this.setTextureName("cubeground:" + unlocalizedName);
}
public void getSubItems(Item par1, CreativeTabs par2, List par3) {
for (int x = 0; x < this.count; ++x) par3.add(new ItemStack(this, 1, x));
}
public String getUnlocalizedName(ItemStack is) {
return super.getUnlocalizedName(is) + "_" + is.getItemDamage();
}
}
В креатив вкладке 1 предмет, регистрирую 9