Exemple #1
0
 @Override
 public void onCreated(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
   super.onCreated(itemStack, world, entityPlayer);
   NBTTagCompound nbttagcompound = new NBTTagCompound();
   nbttagcompound.setBoolean(KEY_IO_SET, false);
   nbttagcompound.setInteger(KEY_IO_X, -1);
   nbttagcompound.setInteger(KEY_IO_Y, -1);
   nbttagcompound.setInteger(KEY_IO_Z, -1);
   nbttagcompound.setInteger(KEY_DIMENSION, -1);
   itemStack.setTagCompound(nbttagcompound);
 }
  @Override
  public void onCreated(ItemStack itemstack, World world, EntityPlayer entityPlayer) {
    super.onCreated(itemstack, world, entityPlayer);

    if (itemstack.getItemDamage() == 1) {
      if (!itemstack.hasTagCompound()) {
        itemstack.setTagCompound(new NBTTagCompound());
      }

      itemstack.getTagCompound().setFloat("MeteorBurnTimeF", ItemMeteorChunk.METEOR_BURN_TIME);
    }
  }