@Override protected void writeEntityToNBT(NBTTagCompound tag) { NBTTagList fires = new NBTTagList(); for (BlockCoord b : fire) { NBTTagCompound block = new NBTTagCompound(); b.writeToNBT(block); fires.appendTag(block); } tag.setTag("blockCoords", fires); }
@Override protected void readEntityFromNBT(NBTTagCompound tag) { if (fire != null) fire.clear(); else fire = new ArrayList<BlockCoord>(); NBTTagList fires = tag.getTagList("blockCoords", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < fires.tagCount(); i++) { fire.add(BlockCoord.readFromNBT(fires.getCompoundTagAt(i))); } }