Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void requestEnergy(Orientations from, int is) {
- ((PipeTransportPower)this.transport).step();
- if (!canReceive) //No need to waste CPU
- return;
- List<PipePowerTeleport> pipeList = getConnectedPipes(true);
- if (pipeList.size() == 0)
- return;
- for (int a=0; a<pipeList.size(); a++) {
- LinkedList<Orientations> theList = getRealPossibleMovements(pipeList.get(a).getPosition());
- if (theList.size() > 0)
- {
- for (int b=0; b<theList.size(); b++)
- {
- Orientations newPos = theList.get(b);
- Position destPos = new Position(pipeList.get(a).xCoord, pipeList.get(a).yCoord, pipeList.get(a).zCoord, newPos);
- destPos.moveForwards(1.0);
- //System.out.println(getPosition().toString() + " RequestEnergy: " + from.toString() + " - Val: " + is + " - Dest: " + destPos.toString());
- TileEntity tile = worldObj.getBlockTileEntity((int)destPos.x, (int)destPos.y, (int)destPos.z);
- if (tile instanceof TileGenericPipe) {
- TileGenericPipe nearbyTile = (TileGenericPipe) tile;
- PipeTransportPower nearbyTransport = (PipeTransportPower) nearbyTile.pipe.transport;
- nearbyTransport.requestEnergy(newPos.reverse(), is);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment