@Override public void readEntityFromNBT(NBTTagCompound nbt) { super.readEntityFromNBT(nbt); this.fuseTicks = nbt.getShort("Fuse"); if (nbt.hasKey("ex")) { ex = ExplosiveRegistry.get(nbt.getString("ex")); ex_size = Math.max(nbt.getDouble("size"), 1.0); if (nbt.hasKey("ex_data")) ex_data = nbt.getCompoundTag("ex_data"); } }
@Override public void readSpawnData(ByteBuf buffer) { boolean ex_exists = buffer.readBoolean(); if (ex_exists) { ex = ExplosiveRegistry.get(ByteBufUtils.readUTF8String(buffer)); ex_data = ByteBufUtils.readTag(buffer); } else { ex = null; ex_data = null; } }