Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void findBlock() {
- int xCoord = this.pos.getX();
- int yCoord = this.pos.getY();
- int zCoord = this.pos.getZ();
- if (isMachine(xCoord + 1, yCoord, zCoord)) {
- machine[0] = (IEnergyAccepter) worldObj.getTileEntity(new BlockPos(xCoord + 1, yCoord, zCoord));
- } else machine[0] = null;
- if (isMachine(xCoord - 1, yCoord, zCoord)) {
- machine[1] = (IEnergyAccepter) worldObj.getTileEntity(new BlockPos(xCoord - 1, yCoord, zCoord));
- } else machine[1] = null;
- if (isMachine(xCoord, yCoord + 1, zCoord)) {
- machine[2] = (IEnergyAccepter) worldObj.getTileEntity(new BlockPos(xCoord, yCoord + 1, zCoord));
- } else machine[2] = null;
- if (isMachine(xCoord, yCoord - 1, zCoord)) {
- machine[3] = (IEnergyAccepter) worldObj.getTileEntity(new BlockPos(xCoord, yCoord - 1, zCoord));
- } else machine[3] = null;
- if (isMachine(xCoord, yCoord, zCoord + 1)) {
- machine[4] = (IEnergyAccepter) worldObj.getTileEntity(new BlockPos(xCoord, yCoord, zCoord + 1));
- } else machine[4] = null;
- if (isMachine(xCoord, yCoord, zCoord - 1)) {
- machine[5] = (IEnergyAccepter) worldObj.getTileEntity(new BlockPos(xCoord, yCoord, zCoord - 1));
- }else machine[5] = null;
- }
- @Override
- public boolean isMachine(int x, int y, int z) {
- return this.worldObj.getTileEntity(new BlockPos(x, y, z)) instanceof IEnergyAccepter;
- }
Advertisement
Add Comment
Please, Sign In to add comment