Java Code Examples for net.minecraft.init.Blocks.stained_glass()

The following are Jave code examples for showing how to use stained_glass() of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: BlockBreakable.java   View Source Code Vote up 6 votes
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (this == Blocks.glass || this == Blocks.stained_glass)
    {
        if (worldIn.getBlockState(pos.offset(side.getOpposite())) != iblockstate)
        {
            return true;
        }

        if (block == this)
        {
            return false;
        }
    }

    return !this.ignoreSimilarity && block == this ? false : super.shouldSideBeRendered(worldIn, pos, side);
}
 
Example 2
Project: BaseClient   File: BlockBreakable.java   View Source Code Vote up 6 votes
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (this == Blocks.glass || this == Blocks.stained_glass)
    {
        if (worldIn.getBlockState(pos.offset(side.getOpposite())) != iblockstate)
        {
            return true;
        }

        if (block == this)
        {
            return false;
        }
    }

    return !this.ignoreSimilarity && block == this ? false : super.shouldSideBeRendered(worldIn, pos, side);
}
 
Example 3
Project: BaseClient   File: BlockBreakable.java   View Source Code Vote up 6 votes
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (this == Blocks.glass || this == Blocks.stained_glass)
    {
        if (worldIn.getBlockState(pos.offset(side.getOpposite())) != iblockstate)
        {
            return true;
        }

        if (block == this)
        {
            return false;
        }
    }

    return !this.ignoreSimilarity && block == this ? false : super.shouldSideBeRendered(worldIn, pos, side);
}
 
Example 4
Project: connor41-etfuturum2   File: OceanMonument.java   View Source Code Vote up 6 votes
public static void generateFile(World world, int x, int y, int z, String path) {
	try {
		BufferedWriter bw = new BufferedWriter(new FileWriter(new File(path)));

		for (int i = 0; i < 58; i++)
			for (int j = 0; j < 31 - 9; j++)
				for (int k = 0; k < 58; k++) {
					Block b = world.getBlock(x + i, y + j, z + k);
					int meta = world.getBlockMetadata(x + i, y + j, z + k);

					String s = "(" + i + ", " + j + ", " + k + ") - ";
					if (b == ModBlocks.prismarine)
						s += meta;
					else if (b == ModBlocks.sea_lantern)
						s += 3;
					else if (b == Blocks.gold_block)
						s += 4;
					else if (b == Blocks.sponge)
						s += 5;
					else if (b == Blocks.stained_glass)
						s += 6;
					else
						s = null;

					if (s != null) {
						bw.write(s);
						bw.newLine();
					}
				}

		bw.close();
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
Example 5
Project: DecompiledMinecraft   File: BlockTorch.java   View Source Code Vote up 5 votes
private boolean canPlaceOn(World worldIn, BlockPos pos)
{
    if (World.doesBlockHaveSolidTopSurface(worldIn, pos))
    {
        return true;
    }
    else
    {
        Block block = worldIn.getBlockState(pos).getBlock();
        return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block == Blocks.stained_glass;
    }
}
 
Example 6
Project: DecompiledMinecraft   File: BlockTorch.java   View Source Code Vote up 5 votes
private boolean canPlaceOn(World worldIn, BlockPos pos)
{
    if (World.doesBlockHaveSolidTopSurface(worldIn, pos))
    {
        return true;
    }
    else
    {
        Block block = worldIn.getBlockState(pos).getBlock();
        return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block == Blocks.stained_glass;
    }
}
 
Example 7
Project: BaseClient   File: BlockTorch.java   View Source Code Vote up 5 votes
private boolean canPlaceOn(World worldIn, BlockPos pos) {
	if (World.doesBlockHaveSolidTopSurface(worldIn, pos)) {
		return true;
	} else {
		Block block = worldIn.getBlockState(pos).getBlock();
		return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall
				|| block == Blocks.stained_glass;
	}
}
 
Example 8
Project: BaseClient   File: BlockTorch.java   View Source Code Vote up 5 votes
private boolean canPlaceOn(World worldIn, BlockPos pos)
{
    if (World.doesBlockHaveSolidTopSurface(worldIn, pos))
    {
        return true;
    }
    else
    {
        Block block = worldIn.getBlockState(pos).getBlock();
        return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block == Blocks.stained_glass;
    }
}
 
Example 9
Project: DecompiledMinecraft   File: BlockPane.java   View Source Code Vote up 4 votes
public final boolean canPaneConnectToBlock(Block blockIn)
{
    return blockIn.isFullBlock() || blockIn == this || blockIn == Blocks.glass || blockIn == Blocks.stained_glass || blockIn == Blocks.stained_glass_pane || blockIn instanceof BlockPane;
}
 
Example 10
Project: DecompiledMinecraft   File: BlockPane.java   View Source Code Vote up 4 votes
public final boolean canPaneConnectToBlock(Block blockIn)
{
    return blockIn.isFullBlock() || blockIn == this || blockIn == Blocks.glass || blockIn == Blocks.stained_glass || blockIn == Blocks.stained_glass_pane || blockIn instanceof BlockPane;
}
 
Example 11
Project: BaseClient   File: BlockPane.java   View Source Code Vote up 4 votes
public final boolean canPaneConnectToBlock(Block blockIn)
{
    return blockIn.isFullBlock() || blockIn == this || blockIn == Blocks.glass || blockIn == Blocks.stained_glass || blockIn == Blocks.stained_glass_pane || blockIn instanceof BlockPane;
}
 
Example 12
Project: BaseClient   File: BlockPane.java   View Source Code Vote up 4 votes
public final boolean canPaneConnectToBlock(Block blockIn)
{
    return blockIn.isFullBlock() || blockIn == this || blockIn == Blocks.glass || blockIn == Blocks.stained_glass || blockIn == Blocks.stained_glass_pane || blockIn instanceof BlockPane;
}
 
Example 13
Project: connor41-etfuturum2   File: TileEntityNewBeacon.java   View Source Code Vote up 4 votes
private void updateSegments() {
	int x = xCoord;
	int y = yCoord;
	int z = zCoord;
	segments.clear();
	TileEntityNewBeacon.BeamSegment beamsegment = new TileEntityNewBeacon.BeamSegment(EntitySheep.fleeceColorTable[0]);
	segments.add(beamsegment);
	boolean flag = true;

	for (int i = y + 1; i < worldObj.getActualHeight(); i++) {
		Block iblockstate = worldObj.getBlock(x, i, z);
		float[] colours;

		if (iblockstate == Blocks.stained_glass)
			colours = EntitySheep.fleeceColorTable[worldObj.getBlockMetadata(x, i, z)];
		else {
			if (iblockstate != Blocks.stained_glass_pane) {
				if (iblockstate.getLightOpacity() >= 15) {
					segments.clear();
					break;
				}

				beamsegment.func_177262_a();
				continue;
			}

			colours = EntitySheep.fleeceColorTable[worldObj.getBlockMetadata(x, i, z)];
		}

		if (!flag)
			colours = new float[] { (beamsegment.func_177263_b()[0] + colours[0]) / 2.0F, (beamsegment.func_177263_b()[1] + colours[1]) / 2.0F, (beamsegment.func_177263_b()[2] + colours[2]) / 2.0F };

		if (Arrays.equals(colours, beamsegment.func_177263_b()))
			beamsegment.func_177262_a();
		else {
			beamsegment = new TileEntityNewBeacon.BeamSegment(colours);
			segments.add(beamsegment);
		}

		flag = false;
	}
}