Java Code Examples for net.minecraft.init.Blocks#WOOL

The following examples show how to use net.minecraft.init.Blocks#WOOL . These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
/**
 * This is for stripping a chunk of all but ore and BEDROCK for easier testing.
 */
protected void stripChunk(ChunkPrimer primer)
{
	Point p;
	Center closestCenter;
	IBlockState state;
	for(int x = 0; x < 16; x++)
	{
		for(int z = 0; z < 16; z++)
		{
			p = new Point(x, z);
			closestCenter = this.getHex(p);
			int hexElev = this.getHexElevation(closestCenter, p);

			if(closestCenter.hasAnyMarkersOf(Marker.Coast, Marker.Ocean))
				continue;

			for(int y = hexElev; y >= 0; y--)
			{
				state = primer.getBlockState(x, y, z);
				if(state.getBlock() != TFCBlocks.Ore && state.getBlock() != Blocks.BEDROCK && state.getBlock() != Blocks.WOOL)
				{
					primer.setBlockState(x, y, z, Blocks.AIR.getDefaultState());
				}
			}
		}
	}
}
 
Example 2
Source Project: TofuCraftReload   File: ItemSoybeans.java    License: MIT License 4 votes vote down vote up
@Override
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
{
    ItemStack item = playerIn.getHeldItem(hand);

    if(item.getItem() == this &&!item.isEmpty()) {
        if (side != EnumFacing.UP) {
            return EnumActionResult.PASS;
        } else if (playerIn.canPlayerEdit(pos, side, item) && playerIn.canPlayerEdit(pos.up(), side, item)) {
            IBlockState soil = worldIn.getBlockState(pos);

            if (soil != null && worldIn.isAirBlock(pos.up())) {
                boolean isPlanted = false;

                if (soil.getBlock() == BlockLoader.TOFUFARMLAND||soil.getBlock().canSustainPlant(soil, worldIn, pos, EnumFacing.UP, this)) {
                    worldIn.setBlockState(pos.up(), BlockLoader.SOYBEAN.getDefaultState());
                    isPlanted = true;
                } else if (soil.getBlock() == Blocks.WOOL) {
                    worldIn.setBlockState(pos.up(), BlockLoader.SPROUTS.getDefaultState());
                    isPlanted = true;
                }
                /*TcAchievementMgr.achieve(playerIn, Key.sproutPlanting);*//*
                    
                }*/
                if (isPlanted) {
                    item.shrink(1);
                    return EnumActionResult.SUCCESS;
                } else {
                    return EnumActionResult.PASS;
                }
            } else {
                return EnumActionResult.PASS;
            }
            //return EnumActionResult.PASS;
        }
        return EnumActionResult.PASS;
    }
    else
    {
        return EnumActionResult.PASS;
    }
}
 
Example 3
Source Project: TofuCraftReload   File: BlockSprouts.java    License: MIT License 4 votes vote down vote up
protected boolean canSustainBush(IBlockState state) {
    return state.getBlock() == Blocks.WOOL;
}