private void putParts(DataHelper data, NBTTagCompound tag) { if (data.isReader()) { loadParts(tag); } else { writeParts(tag); } }
@Override public void putData(DataHelper data) throws IOException { lastTouched = data.as(Share.VISIBLE, "touch").putInt(lastTouched); totalHeat = data.as(Share.VISIBLE, "heat").putInt(totalHeat); glazesApplied = data.as(Share.PRIVATE, "glazed").putBoolean(glazesApplied); front = data.as(Share.VISIBLE, "front").putEnum(front); setRotation(data.as(Share.VISIBLE, "rot").putByte(rotation)); if (data.isNBT()) { putParts(data, data.getTag()); } else if (data.isReader()) { NBTTagCompound tag = data.as(Share.VISIBLE, "partList").putTag(new NBTTagCompound()); putParts(data, tag); } else { NBTTagCompound tag = new NBTTagCompound(); putParts(data, tag); tag = data.as(Share.VISIBLE, "partList").putTag(tag); } if (data.isReader()) { cache_dirty = true; } }