@Override public void writeEntityToNBT(NBTTagCompound nbt) { super.writeEntityToNBT(nbt); nbt.setString("Name", getName()); nbt.setString("Model", dataWatcher.getWatchableObjectString(4)); if (npcLocation == null) npcLocation = SpawnLocation.Land; nbt.setInteger("trainerLocation", npcLocation.index); }
@Override public void writeEntityToNBT(NBTTagCompound nbt) { super.writeEntityToNBT(nbt); nbt.setInteger("spiderType", spiderType.getId()); nbt.setInteger("abilityCounter", abilityCounter); nbt.setInteger("abilityThreshold", abilityThreshold); nbt.setInteger("killsUntilLevelUp", killsUntilLevelUp); nbt.setLong("ownerMSB", owner.getMostSignificantBits()); nbt.setLong("ownerLSB", owner.getLeastSignificantBits()); nbt.setTag("inventory", inventory.saveInventoryToNBT()); }
/** (abstract) Protected helper method to write subclass entity data to NBT. */ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); par1NBTTagCompound.setInteger("Age", this.getGrowingAge()); }