@Override public void writeSpawnData(ByteBuf buffer) { buffer.writeInt(spiderType.getId()); if (owner != null) { buffer.writeLong(owner.getMostSignificantBits()); buffer.writeLong(owner.getLeastSignificantBits()); } }
@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()); }