public void readFromNBT(NBTTagCompound nbt) { NBTTagList list = nbt.getTagList("GatheringLocations", 10); for (int i = 0; i < list.tagCount(); i++) { NBTTagCompound tag = list.getCompoundTagAt(i); GatheringLocation location = new GatheringLocation(); location.readFromNBT(tag); locations.add(location); } }
public void writeToNBT(NBTTagCompound nbt) { NBTTagList list = new NBTTagList(); for (GatheringLocation location : locations) { NBTTagCompound tag = new NBTTagCompound(); location.writeToNBT(tag); list.appendTag(tag); } nbt.setTag("GatheringLocations", list); }