@Override public void writeToNBT(NBTTagCompound tag) { super.writeToNBT(tag); tag.setInteger("workingTick", this.workingTick); tag.setIntArray("coordinates", this.coordinates); tag.setByte("searchingTick", this.searchingTick); tag.setInteger("coolDown", this.coolDown); }
@Override public void readFromNBT(NBTTagCompound tag) { super.readFromNBT(tag); this.workingTick = tag.getInteger("workingTick"); this.coordinates = tag.getIntArray("coordinates"); this.searchingTick = tag.getByte("searchingTick"); this.coolDown = tag.getInteger("coolDown"); if (coordinates.length < 3) { coordinates = new int[3]; coordinates[0] = this.xCoord; coordinates[1] = this.yCoord; coordinates[2] = this.zCoord; } }