Java Code Examples for net.minecraftforge.common.EnumPlantType#Plains

The following examples show how to use net.minecraftforge.common.EnumPlantType#Plains . 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: BlockGrass.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
	IBlockState plant = plantable.getPlant(world, pos.offset(direction));
	net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

	if(plant.getBlock() == Blocks.SAPLING)
		return false;//This may break some cross mod compatability but for now its needed to prevent vanilla and some pam trees from generating

	if(plantType == EnumPlantType.Plains)
		return true;

	if(plant.getBlock() == TFCBlocks.VegDesert)
		return true;
	return false;
}
 
Example 2
Source File: BlockFarmland.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
	IBlockState plant = plantable.getPlant(world, pos.offset(direction));
	net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

	if(plantType == EnumPlantType.Crop)
		return true;

	if(plantType == EnumPlantType.Plains)
		return true;

	if(plantable == TFCBlocks.Sapling)
		return true;

	return false;
}
 
Example 3
Source File: BlockDirt.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
/*******************************************************************************
 * 1. Content
 *******************************************************************************/

@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
	IBlockState plant = plantable.getPlant(world, pos.offset(direction));
	net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

	if(plantType == EnumPlantType.Plains)
		return true;
	return false;
}
 
Example 4
Source File: ItemSeedBase.java    From ExNihiloAdscensio with MIT License 5 votes vote down vote up
public ItemSeedBase(String name, IBlockState plant) {
	super();
	this.setRegistryName("itemSeed" + StringUtils.capitalize(name));
	this.setUnlocalizedName("itemSeed" + StringUtils.capitalize(name));
	this.plant = plant;
	this.name = name;
	type = EnumPlantType.Plains;
	
	GameRegistry.<Item>register(this);
}
 
Example 5
Source File: BlockMapleSaplingRed.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
Example 6
Source File: BlockVegetation.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) 
{
	return EnumPlantType.Plains;
}
 
Example 7
Source File: BlockGregSapling.java    From GregTech with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Plains;
}
 
Example 8
Source File: BlockPlantBamboo.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Plains;
}
 
Example 9
Source File: BlockBambooShoot.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Plains;
}
 
Example 10
Source File: BlockMapleSaplingOrange.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
Example 11
Source File: BlockLeek.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Plains;
}
 
Example 12
Source File: BlockMapleSaplingYellow.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
Example 13
Source File: BlockSakuraSapling.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
Example 14
Source File: BlockMapleSaplingGreen.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
Example 15
Source File: BlockGrapeLeaves.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
Example 16
Source File: BlockGrapeVine.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
Example 17
Source File: BlockVanillaCrop.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
Example 18
Source File: BlockTofuFlower.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Plains;
}
 
Example 19
Source File: BlockTofuSapling.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Plains;
}
 
Example 20
Source File: BlockApricotSapling.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
public net.minecraftforge.common.EnumPlantType getPlantType(net.minecraft.world.IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Plains;
}