Пример #1
0
 @Override
 @Method(modid = "appliedenergistics2")
 public void onRemovedFromBundle() {
   super.onRemovedFromBundle();
   getNode().destroy();
   getBundle().setGridNode(null);
 }
Пример #2
0
 @Override
 @Method(modid = "appliedenergistics2")
 public void onChunkUnload(World worldObj) {
   super.onChunkUnload(worldObj);
   if (getNode() != null) {
     getNode().destroy();
     getBundle().setGridNode(null);
   }
 }
Пример #3
0
 @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;
   }
 }
Пример #4
0
 @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);
     }
   }
 }
Пример #5
0
  @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);
  }
Пример #6
0
 @Override
 public void writeToNBT(NBTTagCompound nbtRoot) {
   super.writeToNBT(nbtRoot);
   nbtRoot.setBoolean("isDense", isDense);
   nbtRoot.setInteger("playerID", playerID);
 }