net.minecraft.block.SaplingBlock Java Examples

The following examples show how to use net.minecraft.block.SaplingBlock. 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: BonemealAuraHack.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
private boolean isCorrectBlock(BlockPos pos)
{
	Block block = BlockUtils.getBlock(pos);
	
	if(!(block instanceof Fertilizable) || block instanceof GrassBlock
		|| !((Fertilizable)block).canGrow(MC.world, MC.world.random, pos,
			BlockUtils.getState(pos)))
		return false;
	
	if(block instanceof SaplingBlock)
		return saplings.isChecked();
	else if(block instanceof CropBlock)
		return crops.isChecked();
	else if(block instanceof StemBlock)
		return stems.isChecked();
	else if(block instanceof CocoaBlock)
		return cocoa.isChecked();
	else
		return other.isChecked();
}
 
Example #2
Source File: IPlantable.java    From patchwork-api with GNU Lesser General Public License v2.1 5 votes vote down vote up
default PlantType getPlantType(BlockView world, BlockPos pos) {
	if (this instanceof CropBlock) return PlantType.Crop;
	if (this instanceof SaplingBlock) return PlantType.Plains;
	if (this instanceof FlowerBlock) return PlantType.Plains;
	if (this == Blocks.CACTUS) return PlantType.Desert;
	if (this == Blocks.LILY_PAD) return PlantType.Water;
	if (this == Blocks.RED_MUSHROOM) return PlantType.Cave;
	if (this == Blocks.BROWN_MUSHROOM) return PlantType.Cave;
	if (this == Blocks.NETHER_WART) return PlantType.Nether;
	if (this == Blocks.TALL_GRASS) return PlantType.Plains;
	return net.minecraftforge.common.PlantType.Plains;
}