Search in sources :

Example 1 with IconOverlay

use of powercrystals.minefactoryreloaded.render.IconOverlay 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);
}
Also used : IconOverlay(powercrystals.minefactoryreloaded.render.IconOverlay) BlockPosition(powercrystals.core.position.BlockPosition)

Example 2 with IconOverlay

use of powercrystals.minefactoryreloaded.render.IconOverlay 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);
}
Also used : IconOverlay(powercrystals.minefactoryreloaded.render.IconOverlay) BlockPosition(powercrystals.core.position.BlockPosition)

Aggregations

BlockPosition (powercrystals.core.position.BlockPosition)2 IconOverlay (powercrystals.minefactoryreloaded.render.IconOverlay)2