@Override @Method(modid = "appliedenergistics2") public void onRemovedFromBundle() { super.onRemovedFromBundle(); getNode().destroy(); getBundle().setGridNode(null); }
@Override @Method(modid = "appliedenergistics2") public void onChunkUnload(World worldObj) { super.onChunkUnload(worldObj); if (getNode() != null) { getNode().destroy(); getBundle().setGridNode(null); } }
@Override public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) { super.readFromNBT(nbtRoot, nbtVersion); isDense = nbtRoot.getBoolean("isDense"); if (nbtRoot.hasKey("playerID")) { playerID = nbtRoot.getInteger("playerID"); } else { playerID = -1; } }
@Override @Method(modid = "appliedenergistics2") public void connectionsChanged() { super.connectionsChanged(); BlockCoord loc = getLocation(); if (loc != null) { onNodeChanged(loc); IGridNode node = getNode(); if (node != null) { node.updateState(); node.getWorld().markBlockForUpdate(loc.x, loc.y, loc.z); } } }
@Override @Method(modid = "appliedenergistics2") public void updateEntity(World worldObj) { if (grid == null) { grid = new MEConduitGrid(this); } if (getNode() == null && !worldObj.isRemote) { IGridNode node = AEApi.instance().createGridNode(grid); if (node != null) { node.setPlayerID(playerID); getBundle().setGridNode(node); getNode().updateState(); } } super.updateEntity(worldObj); }
@Override public void writeToNBT(NBTTagCompound nbtRoot) { super.writeToNBT(nbtRoot); nbtRoot.setBoolean("isDense", isDense); nbtRoot.setInteger("playerID", playerID); }