public void b(NBTTagCompound nbttagcompound) { if (this.getItem() != null) { nbttagcompound.set("Item", this.getItem().save(new NBTTagCompound())); nbttagcompound.setByte("ItemRotation", (byte) this.getRotation()); nbttagcompound.setFloat("ItemDropChance", this.e); } super.b(nbttagcompound); }
public void a(NBTTagCompound nbttagcompound) { NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Item"); if (nbttagcompound1 != null && !nbttagcompound1.isEmpty()) { this.setItem(ItemStack.createStack(nbttagcompound1)); this.setRotation(nbttagcompound.getByte("ItemRotation")); if (nbttagcompound.hasKeyOfType("ItemDropChance", 99)) { this.e = nbttagcompound.getFloat("ItemDropChance"); } } super.a(nbttagcompound); }
/** (abstract) Protected helper method to read subclass entity data from NBT. */ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { String var2 = par1NBTTagCompound.getString("Motive"); EnumArt[] var3 = EnumArt.values(); int var4 = var3.length; for (int var5 = 0; var5 < var4; ++var5) { EnumArt var6 = var3[var5]; if (var6.title.equals(var2)) { this.art = var6; } } if (this.art == null) { this.art = EnumArt.Kebab; } super.readEntityFromNBT(par1NBTTagCompound); }
/** (abstract) Protected helper method to write subclass entity data to NBT. */ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.setString("Motive", this.art.title); super.writeEntityToNBT(par1NBTTagCompound); }