Guest User

Untitled

a guest
Feb 23rd, 2012
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. @Override
  2.     public void requestEnergy(Orientations from, int is) {
  3.         ((PipeTransportPower)this.transport).step();
  4.         if (!canReceive) //No need to waste CPU
  5.             return;
  6.         List<PipePowerTeleport> pipeList = getConnectedPipes(true);
  7.         if (pipeList.size() == 0)
  8.             return;
  9.  
  10.         for (int a=0; a<pipeList.size(); a++) {
  11.             LinkedList<Orientations> theList = getRealPossibleMovements(pipeList.get(a).getPosition());
  12.             if (theList.size() > 0)
  13.             {
  14.                 for (int b=0; b<theList.size(); b++)
  15.                 {
  16.                     Orientations newPos = theList.get(b);
  17.                     Position destPos = new Position(pipeList.get(a).xCoord, pipeList.get(a).yCoord, pipeList.get(a).zCoord, newPos);
  18.                     destPos.moveForwards(1.0);
  19.  
  20.                     //System.out.println(getPosition().toString() + " RequestEnergy: " + from.toString() + " - Val: " + is + " - Dest: " + destPos.toString());
  21.  
  22.                     TileEntity tile = worldObj.getBlockTileEntity((int)destPos.x, (int)destPos.y, (int)destPos.z);
  23.                     if (tile instanceof TileGenericPipe) {
  24.                         TileGenericPipe nearbyTile = (TileGenericPipe) tile;
  25.                         PipeTransportPower nearbyTransport = (PipeTransportPower) nearbyTile.pipe.transport;
  26.                         nearbyTransport.requestEnergy(newPos.reverse(), is);
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment