use of powercrystals.core.position.BlockPosition in project MineFactoryReloaded by powercrystals.
the class BlockFactoryGlass method getBlockOverlayTexture.
public Icon getBlockOverlayTexture(IBlockAccess world, int x, int y, int z, int side) {
BlockPosition bp;
boolean[] sides = new boolean[8];
if (side <= 1) {
bp = new BlockPosition(x, y, z, ForgeDirection.NORTH);
bp.moveRight(1);
sides[0] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveBackwards(1);
sides[4] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveLeft(1);
sides[1] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveLeft(1);
sides[5] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveForwards(1);
sides[3] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveForwards(1);
sides[6] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveRight(1);
sides[2] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveRight(1);
sides[7] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
} else {
bp = new BlockPosition(x, y, z, ForgeDirection.VALID_DIRECTIONS[side]);
bp.moveRight(1);
sides[0] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveDown(1);
sides[4] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveLeft(1);
sides[1] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveLeft(1);
sides[5] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveUp(1);
sides[3] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveUp(1);
sides[6] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveRight(1);
sides[2] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveRight(1);
sides[7] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
}
return new IconOverlay(_texture, 8, 8, sides);
}
use of powercrystals.core.position.BlockPosition in project MineFactoryReloaded by powercrystals.
the class BlockFactoryGlassPane method getBlockOverlayTexture.
public Icon getBlockOverlayTexture(IBlockAccess world, int x, int y, int z, int side) {
BlockPosition bp = new BlockPosition(x, y, z, ForgeDirection.VALID_DIRECTIONS[side]);
boolean[] sides = new boolean[8];
bp.moveRight(1);
sides[0] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveDown(1);
sides[4] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveLeft(1);
sides[1] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveLeft(1);
sides[5] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveUp(1);
sides[3] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveUp(1);
sides[6] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveRight(1);
sides[2] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
bp.moveRight(1);
sides[7] = world.getBlockId(bp.x, bp.y, bp.z) == blockID;
return new IconOverlay(BlockFactoryGlass._texture, 8, 8, sides);
}
use of powercrystals.core.position.BlockPosition in project MineFactoryReloaded by powercrystals.
the class HarvestAreaManager method getNextBlock.
public BlockPosition getNextBlock() {
checkRecalculate();
BlockPosition next = _harvestedBlocks.get(_currentBlock);
_currentBlock++;
if (_currentBlock >= _harvestedBlocks.size()) {
_currentBlock = 0;
}
return next;
}
use of powercrystals.core.position.BlockPosition in project MineFactoryReloaded by powercrystals.
the class MFRUtil method directionsWithoutConveyors.
public static ForgeDirection[] directionsWithoutConveyors(World world, int x, int y, int z) {
ArrayList<ForgeDirection> nonConveyors = new ArrayList<ForgeDirection>();
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
BlockPosition bp = new BlockPosition(x, y, z);
bp.orientation = direction;
bp.moveForwards(1);
TileEntity te = world.getBlockTileEntity(bp.x, bp.y, bp.z);
if (te == null || !(te instanceof TileEntityConveyor)) {
nonConveyors.add(direction);
}
}
return nonConveyors.toArray(new ForgeDirection[nonConveyors.size()]);
}
use of powercrystals.core.position.BlockPosition in project MineFactoryReloaded by powercrystals.
the class ItemNeedlegunAmmoBlock method onHitBlock.
@Override
public void onHitBlock(EntityPlayer owner, World world, int x, int y, int z, int side, double distance) {
BlockPosition bp = new BlockPosition(x, y, z, ForgeDirection.getOrientation(side));
bp.moveForwards(1);
placeBlockAt(world, bp.x, bp.y, bp.z);
}
Aggregations