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

The following examples show how to use net.minecraft.init.Blocks#WOOL . 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: ChunkProviderSurface.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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 File: ItemSoybeans.java    From TofuCraftReload with 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 File: BlockSprouts.java    From TofuCraftReload with MIT License 4 votes vote down vote up
protected boolean canSustainBush(IBlockState state) {
    return state.getBlock() == Blocks.WOOL;
}