Java Code Examples for net.minecraft.world.IBlockAccess#getBlockMetadata()

The following examples show how to use net.minecraft.world.IBlockAccess#getBlockMetadata() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockExtendedNodeJarRenderer.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    int bb = setBrightness(world, x, y, z, block);
    int metadata = world.getBlockMetadata(x, y, z);
    block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13);
    renderer.setRenderBoundsFromBlock(block);
    renderer.renderStandardBlock(block, x, y, z);
    block.setBlockBounds(W5, W12, W5, W11, W14, W11);
    renderer.setRenderBoundsFromBlock(block);
    renderer.renderStandardBlock(block, x, y, z);

    renderer.clearOverrideBlockTexture();
    block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    renderer.setRenderBoundsFromBlock(block);
    return true;
}
 
Example 2
Source File: RotorSimpleRenderer.java    From BigReactors with MIT License 6 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
		Block block, int modelId, RenderBlocks renderer) {
	int metadata = world.getBlockMetadata(x, y, z);
	TileEntity te = world.getTileEntity(x, y, z);
	
	if(te instanceof TileEntityTurbineRotorPart) {
		TileEntityTurbineRotorPart rotorPart = (TileEntityTurbineRotorPart)te;
		if(rotorPart.isConnected() && rotorPart.getTurbine().isAssembled() && rotorPart.getTurbine().getActive()) {
			// Don't draw if the turbine's active.
			return false;
		}
	}
	
	if(BlockTurbineRotorPart.isRotorShaft(metadata)) {
		ForgeDirection majorAxis = findRotorMajorAxis(world, x, y, z, block);
		
		boolean[] hasBlades = findBlades(world, x, y, z, block, majorAxis);
		
		renderRotorShaft(block, renderer, metadata, majorAxis, hasBlades, x, y, z, false);
	}
	else {
		renderBladeFromWorld(renderer, world, x, y, z, block, metadata);
	}
	return true;
}
 
Example 3
Source File: BlockCoverPlate.java    From Artifacts with MIT License 6 votes vote down vote up
@Override
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
   {
       int par1 = (par1IBlockAccess.getBlockMetadata(par2, par3, par4));
       float f = 0.125F;

       if (par1 == 2)
       {
           this.setBlockBounds(0.0F, -1F, 1.0F - f, 1.0F, 1.0F, 1.0F);
       }

       if (par1 == 3)
       {
           this.setBlockBounds(0.0F, -1F, 0.0F, 1.0F, 1.0F, f);
       }

       if (par1 == 4)
       {
           this.setBlockBounds(1.0F - f, -1F, 0.0F, 1.0F, 1.0F, 1.0F);
       }

       if (par1 == 5)
       {
           this.setBlockBounds(0.0F, -1F, 0.0F, f, 1.0F, 1.0F);
       }
   }
 
Example 4
Source File: BlockStoneMachine.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
    int metadata = world.getBlockMetadata(x, y, z);
    if (metadata == 15) {
        setBlockBounds(0, 0, 0, 1, 0.5f, 1);
    } else if (metadata == 11) {
        setBlockBounds(0.0F, -1.0F, 0.0F, 1.0F, -0.5F, 1.0F);
    } else if (metadata == 0 || metadata == 3) {
        setBlockBounds(3 / 16f, 0, 3 / 16f, 1 - (3 / 16f), 6 / 16f, 1 - (3 / 16f));
    } else if (metadata == 1) {
        setBlockBounds(0.25f, 0, 0.25f, 0.75f, 0.99f, 0.75f);
    } else if(metadata == 2) {
        setBlockBounds(0, 0, 0, 1, 3/16f, 1);
    } else if(metadata == 4) {
         setBlockBounds(0, 0, 0, 1, 12/16f, 1);
    }/* else if(metadata == 5) {
        setBlockBounds(0, 0, 0, 1, 1, 1);
    }*/
    super.setBlockBoundsBasedOnState(world, x, y, z);
}
 
Example 5
Source File: BlockTrap.java    From Artifacts with MIT License 6 votes vote down vote up
public IIcon neighborBlockTexture(IBlockAccess world, int x, int y, int z, int side, int mymeta) {
	Block[] blocks = {world.getBlock(x, y, z+1),world.getBlock(x, y, z-1),world.getBlock(x+1, y, z),world.getBlock(x-1, y, z)};
    int[] meta = {world.getBlockMetadata(x, y, z+1),world.getBlockMetadata(x, y, z-1),world.getBlockMetadata(x+1, y, z),world.getBlockMetadata(x-1, y, z)};
    for(int i = 0; i < blocks.length; i++) {
    	if(i+2 != mymeta) {
     	if(blocks[i] != null) {
     		if(blocks[i] != this && ! (blocks[i] instanceof BlockWallPlate) && ! (blocks[i] instanceof BlockArtifactsPressurePlate)) {
     			IIcon icon = blocks[i].getIcon(side, meta[i]);
      		if(icon != null) {
      			return icon;
      		}
     		}
     	}
    	}
    }
	return Blocks.stonebrick.getBlockTextureFromSide(1);
}
 
Example 6
Source File: BlockTrap.java    From Artifacts with MIT License 5 votes vote down vote up
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
	int m = world.getBlockMetadata(x, y, z) & 7;
	int k = side & 7;
	if(m == k) {
		return neighborBlockTexture(world, x, y, z, side, m);
	}
	return getIcon(m,side);
}
 
Example 7
Source File: BlockNoCTMRenderer.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
    int meta = world.getBlockMetadata(x, y, z);

    if(meta != 0) renderer.overrideBlockTexture = block.getIcon(0, meta);
    renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    renderer.renderStandardBlock(block, x, y, z);
    renderer.overrideBlockTexture = null;

    return false;
}
 
Example 8
Source File: BlockAuraPylon.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z) {
    int meta = world.getBlockMetadata(x, y, z);
    if(meta == 1) {
        return 10;
    }
    return super.getLightValue(world, x, y, z);
}
 
Example 9
Source File: BlockTerminalFluid.java    From ExtraCells1 with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side)
{
	TileEntity tileentity = blockAccess.getBlockTileEntity(x, y, z);
	int metadata = blockAccess.getBlockMetadata(x, y, z);

	if (tileentity != null)
	{
		return side == metadata ? frontIcon : side == 0 ? bottomIcon : side == 1 ? topIcon : sideIcon;
	}
	return null;
}
 
Example 10
Source File: CarvableHelper.java    From Chisel-2 with GNU General Public License v2.0 5 votes vote down vote up
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
	int metadata = world.getBlockMetadata(x, y, z);

	if (metadata < 0 || metadata > 15)
		metadata = 0;

	IVariationInfo info = infoMap[metadata];
	if (info == null)
		return getMissingIcon();

	return info.getIcon(world, x, y, z, side);
}
 
Example 11
Source File: BlockSnakeStoneRenderer.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
    int meta = world.getBlockMetadata(x, y, z);

    setRenderRotate(renderer, (BlockSnakestone) block, meta);
    boolean didRender = renderer.renderStandardBlock(block, x, y, z);
    restoreRendererRotate(renderer);

    return didRender;
}
 
Example 12
Source File: BlockBloomeryFurnace.java    From GardenCollection with MIT License 5 votes vote down vote up
@Override
public int getLightValue (IBlockAccess world, int x, int y, int z) {
    int meta = world.getBlockMetadata(x, y, z);
    if ((meta & 0x8) == 0)
        return 0;
    else
        return 14;
}
 
Example 13
Source File: LargePotRenderer.java    From GardenCollection with MIT License 4 votes vote down vote up
private boolean renderWorldBlockPass0 (IBlockAccess world, int x, int y, int z, BlockLargePot block, int modelId, RenderBlocks renderer) {
    int metadata = world.getBlockMetadata(x, y, z);

    boxRenderer.setUnit(.0625);
    boxRenderer.setColor(ModularBoxRenderer.COLOR_WHITE);
    for (int i = 0; i < 6; i++)
        boxRenderer.setIcon(renderer.getBlockIconFromSideAndMetadata(block, i, metadata), i);

    TileEntityLargePot te = block.getTileEntity(world, x, y, z);

    int connectFlags = 0;
    connectFlags |= te.isAttachedNeighbor(x - 1, y, z - 1) ? ModularBoxRenderer.CONNECT_ZNEG_XNEG : 0;
    connectFlags |= te.isAttachedNeighbor(x, y, z - 1) ? ModularBoxRenderer.CONNECT_ZNEG : 0;
    connectFlags |= te.isAttachedNeighbor(x + 1, y, z - 1) ? ModularBoxRenderer.CONNECT_ZNEG_XPOS : 0;
    connectFlags |= te.isAttachedNeighbor(x - 1, y, z) ? ModularBoxRenderer.CONNECT_XNEG : 0;
    connectFlags |= te.isAttachedNeighbor(x + 1, y, z) ? ModularBoxRenderer.CONNECT_XPOS : 0;
    connectFlags |= te.isAttachedNeighbor(x - 1, y, z + 1) ? ModularBoxRenderer.CONNECT_ZPOS_XNEG : 0;
    connectFlags |= te.isAttachedNeighbor(x, y, z + 1) ? ModularBoxRenderer.CONNECT_ZPOS : 0;
    connectFlags |= te.isAttachedNeighbor(x + 1, y, z + 1) ? ModularBoxRenderer.CONNECT_ZPOS_XPOS : 0;

    boxRenderer.renderBox(world, block, x, y, z, 0, 0, 0, 1, 1, 1, connectFlags, ModularBoxRenderer.CUT_YPOS);

    if (te != null && te.getSubstrate() != null && te.getSubstrate().getItem() instanceof ItemBlock) {
        Block substrate = Block.getBlockFromItem(te.getSubstrate().getItem());
        int substrateData = te.getSubstrate().getItemDamage();

        if (substrate != Blocks.water) {
            IIcon substrateIcon = renderer.getBlockIconFromSideAndMetadata(substrate, 1, substrateData);

            int color = substrate.colorMultiplier(world, x, y, z);
            if (color == Blocks.grass.colorMultiplier(world, x, y, z))
                color = ColorizerGrass.getGrassColor(te.getBiomeTemperature(), te.getBiomeHumidity());

            RenderHelper.calculateBaseColor(colorScratch, color);

            RenderHelper.instance.setRenderBounds(0, 0, 0, 1, 1 - .0625, 1);
            RenderHelper.instance.renderFace(RenderHelper.YPOS, world, block, x, y, z, substrateIcon, colorScratch[0], colorScratch[1], colorScratch[2]);
        }
    }

    return true;
}
 
Example 14
Source File: CarvableHelper.java    From Chisel with GNU General Public License v2.0 4 votes vote down vote up
private boolean isSame(IBlockAccess world, int x, int y, int z, Block block, int meta)
{
    return world.getBlock(x, y, z).equals(block) && world.getBlockMetadata(x, y, z) == meta;
}
 
Example 15
Source File: BlockSpikesRenderer.java    From Chisel with GNU General Public License v2.0 4 votes vote down vote up
@Override
    public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
    {
        int meta = world.getBlockMetadata(x, y, z);

        renderer.renderStandardBlock(block, x, y, z);

        Tessellator tessellator = Tessellator.instance;
        IIcon icon = ChiselBlocks.blockSpiketrap.iconSpike;
//		Icon icon=Chisel.blockSpiketrap.iconBase;

        double h = 0.85;
        double d = 1.5 / 16;
        double r = d / 2;


        double tx = x + 0.25;
        double ty = y + h;
        double tz = z + 0.25;
        double skew = 0.5;

        //       tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
        tessellator.addTranslation(0, 1.0f / 16, 0);

        Random rand = new Random();
        for(int xx = 0; xx < 4; xx++)
        {
            for(int yy = 0; yy < 4; yy++)
            {
//				float sx=1.0f/16+rand.nextFloat()*13.0f/16;
//				float sz=1.0f/16+rand.nextFloat()*13.0f/16;
                float sx = (2.0f + (12.0f - (float) d) * xx / 3) / 16;
                float sz = (2.0f + (12.0f - (float) d) * yy / 3) / 16;


                tessellator.addTranslation(sx, 0, sz);
                drawSpike(icon, r, 0.5 + rand.nextDouble() * 0.35, x, y, z, rand.nextDouble() * skew - skew / 2, rand.nextDouble() * skew - skew / 2);
                tessellator.addTranslation(-sx, 0, -sz);
            }
        }

        tessellator.addTranslation(0, -1.0f / 16, 0);


        return true;
    }
 
Example 16
Source File: BlockPneumaticDoor.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z){
    if(isTrackingPlayerEye) {
        setBlockBounds(0, 0, 0, 1, 1, 1);
    } else {
        float xMin = 0;
        float zMin = 0;
        float xMax = 1;
        float zMax = 1;
        TileEntity te = blockAccess.getTileEntity(x, y, z);
        int meta = blockAccess.getBlockMetadata(x, y, z);
        if(te instanceof TileEntityPneumaticDoor) {
            TileEntityPneumaticDoor door = (TileEntityPneumaticDoor)te;
            float cosinus = 13 / 16F - (float)Math.sin(Math.toRadians(door.rotation)) * 13 / 16F;
            float sinus = 13 / 16F - (float)Math.cos(Math.toRadians(door.rotation)) * 13 / 16F;
            if(door.rightGoing) {
                switch(ForgeDirection.getOrientation(meta % 6)){
                    case NORTH:
                        zMin = cosinus;
                        xMax = 1 - sinus;
                        break;
                    case WEST:
                        xMin = cosinus;
                        zMin = sinus;
                        break;
                    case SOUTH:
                        zMax = 1 - cosinus;
                        xMin = sinus;
                        break;
                    case EAST:
                        xMax = 1 - cosinus;
                        zMax = 1 - sinus;
                        break;

                }
            } else {
                switch(ForgeDirection.getOrientation(meta % 6)){
                    case NORTH:
                        zMin = cosinus;
                        xMin = sinus;
                        break;
                    case WEST:
                        xMin = cosinus;
                        zMax = 1 - sinus;
                        break;
                    case SOUTH:
                        zMax = 1 - cosinus;
                        xMax = 1 - sinus;
                        break;
                    case EAST:
                        xMax = 1 - cosinus;
                        zMin = sinus;
                        break;

                }
            }
        }
        setBlockBounds(xMin, meta < 6 ? 0 : -1, zMin, xMax, meta < 6 ? 2 : 1, zMax);
    }
}
 
Example 17
Source File: BlockArtifactsPressurePlate.java    From Artifacts with MIT License 4 votes vote down vote up
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
{
	if(this.camouflaged) {

		if(side != 1) {
			return this == camoStone ? Blocks.stone.getBlockTextureFromSide(0) : this == camoObsidian ? Blocks.obsidian.getBlockTextureFromSide(0) : Blocks.planks.getBlockTextureFromSide(0);
		}

		IIcon icon = this.blockIcon;
		Block block = world.getBlock(x, y-1, z);
		int meta = world.getBlockMetadata(x, y-1, z);

		if(block != null) {
			if(block == BlockTrap.instance) {
				int[] blockToCopyLocation = BlockTrap.getNeighbourBlockPosition(world, x, y-1, z, block, meta);
				Block blockToCopy = Blocks.stonebrick;
				int metaToCopy = 0;
				if(! (blockToCopyLocation[0] == x && blockToCopyLocation[1] == y && blockToCopyLocation[2] == z )) {
					blockToCopy = world.getBlock(blockToCopyLocation[0], blockToCopyLocation[1], blockToCopyLocation[2]);
					metaToCopy = world.getBlockMetadata(blockToCopyLocation[0], blockToCopyLocation[1], blockToCopyLocation[2]);
				}
				return blockToCopy.getIcon(side, metaToCopy);
			}
			else if(block != this && block.isOpaqueCube()) {
				icon = block.getIcon(side, meta);
				if(icon != null) {
					return icon;
				}
			}
			else if(block == BlockIllusionary.instance) {
				return block.getIcon(world, x, y-1, z, side);
				
			}
		}
	}

	//If it fails, return default icon.
			return super.getIcon(world, x, y, z, side);

}
 
Example 18
Source File: DecorativePotRenderer.java    From GardenCollection with MIT License 4 votes vote down vote up
private boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, BlockDecorativePot block, int modelId, RenderBlocks renderer) {
    int data = world.getBlockMetadata(x, y, z);

    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));

    RenderHelper.calculateBaseColor(baseColor, block.colorMultiplier(world, x, y, z));

    float unit = .0625f;

    for (int i = 0; i < 6; i++)
        boxRenderer.setIcon(renderer.getBlockIconFromSideAndMetadata(block, i, data), i);

    boxRenderer.setColor(baseColor);
    boxRenderer.renderBox(world, block, x, y, z, 0, 14 * unit, 0, 1, 1, 1, 0, ModularBoxRenderer.CUT_YNEG | ModularBoxRenderer.CUT_YPOS);
    boxRenderer.setScaledColor(baseColor, .9375f);
    boxRenderer.renderBox(world, block, x, y, z, 1 * unit, 8 * unit, 1 * unit, 15 * unit, 16 * unit, 15 * unit, 0, ModularBoxRenderer.CUT_YPOS);

    boxRenderer.setScaledExteriorColor(baseColor, .875f);
    boxRenderer.renderSolidBox(world, block, x, y, z, 3 * unit, 6 * unit, 3 * unit, 13 * unit, 8 * unit, 13 * unit);
    boxRenderer.setScaledExteriorColor(baseColor, .8125f);
    boxRenderer.renderSolidBox(world, block, x, y, z, 5 * unit, 3 * unit, 5 * unit, 11 * unit, 6 * unit, 11 * unit);
    boxRenderer.setScaledExteriorColor(baseColor, .9375f);
    boxRenderer.setScaledExteriorColor(baseColor, .75f, 1);
    boxRenderer.renderSolidBox(world, block, x, y, z, 2 * unit, 0 * unit, 2 * unit, 14 * unit, 3 * unit, 14 * unit);

    TileEntityDecorativePot te = block.getTileEntity(world, x, y, z);
    ItemStack substrateItem = block.getGardenSubstrate(world, x, y, z, Slot2Profile.SLOT_CENTER);
    if (te != null && substrateItem != null && substrateItem.getItem() instanceof ItemBlock) {
        Block substrate = Block.getBlockFromItem(substrateItem.getItem());
        IIcon substrateIcon = renderer.getBlockIconFromSideAndMetadata(substrate, 1, substrateItem.getItemDamage());

        int color = substrate.colorMultiplier(world, x, y, z);
        if (color == Blocks.grass.colorMultiplier(world, x, y, z))
            color = ColorizerGrass.getGrassColor(te.getBiomeTemperature(), te.getBiomeHumidity());

        RenderHelper.calculateBaseColor(activeSubstrateColor, color);
        RenderHelper.scaleColor(activeSubstrateColor, activeSubstrateColor, .8f);

        RenderHelper.instance.setRenderBounds(.0625f, 0, .0625f, 1f - .0625f, 1f - .0625f, 1f - .0625f);
        RenderHelper.instance.renderFace(RenderHelper.YPOS, world, block, x, y, z, substrateIcon, activeSubstrateColor[0], activeSubstrateColor[1], activeSubstrateColor[2]);
    }

    return true;
}
 
Example 19
Source File: BlockIvy.java    From GardenCollection with MIT License 4 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon (IBlockAccess blockAccess, int x, int y, int z, int side) {
    boolean nTop = blockAccess.getBlock(x, y + 1, z) == this;
    boolean nLeft = false;
    boolean nRight = false;

    int meta = blockAccess.getBlockMetadata(x, y, z);
    switch (side) {
        case 2:
            nLeft = (meta & 8) != 0
                || (blockAccess.getBlock(x + 1, y, z) == this && (blockAccess.getBlockMetadata(x + 1, y, z) & 1) != 0)
                || (blockAccess.getBlock(x + 1, y, z + 1) == this && (blockAccess.getBlockMetadata(x + 1, y, z + 1) & 2) != 0);
            nRight = (meta & 2) != 0
                || (blockAccess.getBlock(x - 1, y, z) == this && (blockAccess.getBlockMetadata(x - 1, y, z) & 1) != 0)
                || (blockAccess.getBlock(x - 1, y, z + 1) == this && (blockAccess.getBlockMetadata(x - 1, y, z + 1) & 8) != 0);
            break;
        case 3:
            nLeft = (meta & 2) != 0
                || (blockAccess.getBlock(x - 1, y, z) == this && (blockAccess.getBlockMetadata(x - 1, y, z) & 4) != 0)
                || (blockAccess.getBlock(x - 1, y, z - 1) == this && (blockAccess.getBlockMetadata(x - 1, y, z - 1) & 8) != 0);
            nRight = (meta & 8) != 0
                || (blockAccess.getBlock(x + 1, y, z) == this && (blockAccess.getBlockMetadata(x + 1, y, z) & 4) != 0)
                || (blockAccess.getBlock(x + 1, y, z - 1) == this && (blockAccess.getBlockMetadata(x + 1, y, z - 1) & 2) != 0);
            break;
        case 4:
            nLeft = (meta & 4) != 0
                || (blockAccess.getBlock(x, y, z - 1) == this && (blockAccess.getBlockMetadata(x, y, z - 1) & 8) != 0)
                || (blockAccess.getBlock(x + 1, y, z - 1) == this && (blockAccess.getBlockMetadata(x + 1, y, z - 1) & 1) != 0);
            nRight = (meta & 1) != 0
                || (blockAccess.getBlock(x, y, z + 1) == this && (blockAccess.getBlockMetadata(x, y, z + 1) & 8) != 0)
                || (blockAccess.getBlock(x + 1, y, z + 1) == this && (blockAccess.getBlockMetadata(x + 1, y, z + 1) & 4) != 0);
            break;
        case 5:
            nLeft = (meta & 1) != 0
                || (blockAccess.getBlock(x, y, z + 1) == this && (blockAccess.getBlockMetadata(x, y, z + 1) & 2) != 0)
                || (blockAccess.getBlock(x - 1, y, z + 1) == this && (blockAccess.getBlockMetadata(x - 1, y, z + 1) & 4) != 0);
            nRight = (meta & 4) != 0
                || (blockAccess.getBlock(x, y, z - 1) == this && (blockAccess.getBlockMetadata(x, y, z - 1) & 2) != 0)
                || (blockAccess.getBlock(x - 1, y, z - 1) == this && (blockAccess.getBlockMetadata(x - 1, y, z - 1) & 1) != 0);
            break;
    }

    if (nTop) {
        if (nLeft && nRight)
            return textures[4];
        else if (nLeft)
            return textures[3];
        else if (nRight)
            return textures[2];
        else
            return textures[1];
    }
    else {
        if (nLeft && nRight)
            return textures[7];
        else if (nLeft)
            return textures[6];
        else if (nRight)
            return textures[5];
        else
            return textures[0];
    }
}
 
Example 20
Source File: GT_Block_CasingsNH.java    From NewHorizonsCoreMod with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int colorMultiplier(IBlockAccess aWorld, int aX, int aY, int aZ) {
    return aWorld.getBlockMetadata(aX, aY, aZ) <= 9 ? super.colorMultiplier(aWorld, aX, aY, aZ) : Dyes.MACHINE_METAL.mRGBa[0] << 16 | Dyes.MACHINE_METAL.mRGBa[1] << 8 | Dyes.MACHINE_METAL.mRGBa[2];
}