Search in sources :

Example 1 with CheckPollinatableTree

use of forestry.arboriculture.genetics.CheckPollinatableTree in project ForestryMC by ForestryMC.

the class GeneticsUtil method getCheckPollinatable.

/**
 * Returns an ICheckPollinatable that can be checked but not mated.
 * Used to check for pollination traits without altering the world by changing vanilla leaves to forestry ones.
 */
public static ICheckPollinatable getCheckPollinatable(World world, final int x, final int y, final int z) {
    TileEntity tile = world.getTileEntity(x, y, z);
    if (tile instanceof IPollinatable) {
        return new CheckPollinatable((IPollinatable) tile);
    }
    ITree pollen = getErsatzPollen(world, x, y, z);
    if (pollen != null) {
        return new CheckPollinatableTree(pollen);
    }
    return null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IPollinatable(forestry.api.genetics.IPollinatable) ITree(forestry.api.arboriculture.ITree) ICheckPollinatable(forestry.arboriculture.genetics.ICheckPollinatable) CheckPollinatable(forestry.arboriculture.genetics.CheckPollinatable) CheckPollinatableTree(forestry.arboriculture.genetics.CheckPollinatableTree)

Aggregations

ITree (forestry.api.arboriculture.ITree)1 IPollinatable (forestry.api.genetics.IPollinatable)1 CheckPollinatable (forestry.arboriculture.genetics.CheckPollinatable)1 CheckPollinatableTree (forestry.arboriculture.genetics.CheckPollinatableTree)1 ICheckPollinatable (forestry.arboriculture.genetics.ICheckPollinatable)1 TileEntity (net.minecraft.tileentity.TileEntity)1