Java Code Examples for net.minecraft.init.Blocks.GLASS

The following are Jave code examples for showing how to use 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.
Example 1
Project: Backmemed   File: BlockBreakable.java   Source Code and License Vote up 6 votes
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
    Block block = iblockstate.getBlock();

    if (this == Blocks.GLASS || this == Blocks.STAINED_GLASS)
    {
        if (blockState != iblockstate)
        {
            return true;
        }

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

    return !this.ignoreSimilarity && block == this ? false : super.shouldSideBeRendered(blockState, blockAccess, pos, side);
}
 
Example 2
Project: CustomWorldGen   File: BlockBreakable.java   Source Code and License Vote up 6 votes
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
    Block block = iblockstate.getBlock();

    if (this == Blocks.GLASS || this == Blocks.STAINED_GLASS)
    {
        if (blockState != iblockstate)
        {
            return true;
        }

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

    return !this.ignoreSimilarity && block == this ? false : super.shouldSideBeRendered(blockState, blockAccess, pos, side);
}
 
Example 3
Project: Loot-Slash-Conquer   File: LSCWorldGenerator.java   Source Code and License Vote up 5 votes
/**
 * Gets the Y-value of the ground at a specifix x/y coordinate.
 * @param world
 * @param x
 * @param z
 * @return
 */
public static int getGroundFromAbove(World world, int x, int z)
{
	int y = 255;
	boolean foundGround = false;
	while(!foundGround && y-- >= 63)
	{
		Block blockAt = world.getBlockState(new BlockPos(x,y,z)).getBlock();
		foundGround = blockAt == Blocks.DIRT || blockAt == Blocks.GRASS || blockAt == Blocks.SAND || blockAt == Blocks.SNOW || blockAt == Blocks.SNOW_LAYER || blockAt == Blocks.GLASS;
	}

	return y;
}
 
Example 4
Project: ArcaneMagic   File: CategoryForgottenKnowledge.java   Source Code and License Vote up 5 votes
@Override
public List<NotebookPage> getPages(INotebookInfo info)
{
	List<NotebookPage> pages = new ArrayList<NotebookPage>();
	List<INotebookEntry> entries = new ArrayList<INotebookEntry>();
	entries.add(new NotebookEntryText(getUnlocalizedName() + "." + 0, 0x000000));
	ItemStack[][] itemsIn = { { ItemStack.EMPTY, new ItemStack(Items.ENDER_PEARL), ItemStack.EMPTY },
			{ new ItemStack(Blocks.PLANKS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.PLANKS) },
			{ new ItemStack(Blocks.PLANKS), ItemStack.EMPTY, new ItemStack(Blocks.PLANKS) } };
	entries.add(new NotebookEntryCraftingRecipe(itemsIn, new ItemStack(ModRegistry.ANALYZER)));
	entries.add(new NotebookEntryText(getUnlocalizedName() + "." + 1, 0x000000));
	pages.add(new NotebookPage(entries));
	return pages;
}
 
Example 5
Project: Backmemed   File: BlockTorch.java   Source Code and License Vote up 5 votes
private boolean canPlaceOn(World worldIn, BlockPos pos)
{
    if (worldIn.getBlockState(pos).isFullyOpaque())
    {
        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: Backmemed   File: BlockPane.java   Source Code and License Vote up 4 votes
public final boolean canPaneConnectToBlock(Block blockIn)
{
    return blockIn.getDefaultState().isFullCube() || blockIn == this || blockIn == Blocks.GLASS || blockIn == Blocks.STAINED_GLASS || blockIn == Blocks.STAINED_GLASS_PANE || blockIn instanceof BlockPane;
}
 
Example 7
Project: CustomWorldGen   File: BlockPane.java   Source Code and License Vote up 4 votes
public final boolean canPaneConnectToBlock(Block blockIn)
{
    return blockIn.getDefaultState().isFullCube() || blockIn == this || blockIn == Blocks.GLASS || blockIn == Blocks.STAINED_GLASS || blockIn == Blocks.STAINED_GLASS_PANE || blockIn instanceof BlockPane;
}