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

The following examples show how to use net.minecraftforge.common.EnumPlantType#Crop . 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: 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 2
Source File: BlockLargePot.java    From GardenCollection with MIT License 5 votes vote down vote up
@Override
public boolean canSustainPlant (IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
    TileEntityGarden gardenTile = getTileEntity(world, x, y, z);
    EnumPlantType plantType = plantable.getPlantType(world, x, y, z);

    if (plantType == EnumPlantType.Crop)
        return substrateSupportsCrops(gardenTile.getSubstrate());

    return false;
}
 
Example 3
Source File: BlockGardenFarmland.java    From GardenCollection with MIT License 5 votes vote down vote up
@Override
public boolean canSustainPlant (IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
    EnumPlantType plantType = plantable.getPlantType(world, x, y, z);
    if (plantType == EnumPlantType.Crop)
        return true;

    return false;
}
 
Example 4
Source File: ItemSoybeans.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
    return EnumPlantType.Crop;
}
 
Example 5
Source File: ItemRiceSeed.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
    return EnumPlantType.Crop;
}
 
Example 6
Source File: ItemSoybeansNether.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
    return EnumPlantType.Crop;
}
 
Example 7
Source File: ItemRiceSeeds.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Crop;
}
 
Example 8
Source File: BlockPepperCrop.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Crop;
}
 
Example 9
Source File: BlockChestnut.java    From Sakura_mod with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
	// TODO Auto-generated method stub
	return EnumPlantType.Crop;
}
 
Example 10
Source File: ItemSeeds.java    From customstuff4 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
    return EnumPlantType.Crop;
}
 
Example 11
Source File: BlockCrops.java    From customstuff4 with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
    return EnumPlantType.Crop;
}
 
Example 12
Source File: ItemSeeds.java    From GardenCollection with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType (IBlockAccess world, int x, int y, int z) {
    return EnumPlantType.Crop;
}
 
Example 13
Source File: BlockCandelilla.java    From GardenCollection with MIT License 4 votes vote down vote up
@Override
public EnumPlantType getPlantType (IBlockAccess world, int x, int y, int z) {
    return EnumPlantType.Crop;
}
 
Example 14
Source File: BlockCrop.java    From AgriCraft with MIT License 2 votes vote down vote up
/**
 * Retrieves the type of plant growing within the crops.
 *
 * @return the plant type in the crops.
 */
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
    return EnumPlantType.Crop;
}