public final class FlowerRegistry extends java.lang.Object implements IFlowerRegistry, IFlowerGrowthHelper
| Constructor and Description |
|---|
FlowerRegistry() |
| Modifier and Type | Method and Description |
|---|---|
IBlockPosPredicate |
createAcceptedFlowerPredicate(java.lang.String flowerType)
Checks a single coordinate to see if it is an accepted flower.
|
java.util.List<net.minecraft.util.math.BlockPos> |
getAcceptedFlowerCoordinates(IBeeHousing beeHousing,
IBee bee,
java.lang.String flowerType,
int maxFlowers) |
java.util.Iterator<net.minecraft.util.math.BlockPos.MutableBlockPos> |
getAreaIterator(IBeeHousing beeHousing,
IBee bee)
Gets an iterator over the area a bee can travel from its beeHousing.
|
Flower |
getRandomPlantableFlower(java.lang.String flowerType,
java.util.Random rand) |
boolean |
growFlower(java.lang.String flowerType,
net.minecraft.world.World world,
IIndividual individual,
net.minecraft.util.math.BlockPos pos)
Deprecated.
|
boolean |
growFlower(java.lang.String flowerType,
net.minecraft.world.World world,
IIndividual individual,
net.minecraft.util.math.BlockPos pos,
java.util.Collection<net.minecraft.block.state.IBlockState> potentialFlowers)
Calls the appropriate IFlowerGrowthRule to grow a flower at a specified position.
|
boolean |
isAcceptedFlower(java.lang.String flowerType,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Deprecated.
|
boolean |
plantRandomFlower(java.lang.String flowerType,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Plants a random flower from flowerType at the specified position.
|
boolean |
plantRandomFlower(java.lang.String flowerType,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
java.util.Collection<net.minecraft.block.state.IBlockState> potentialFlowers)
Plants a random flower from flowerType at the specified position.
|
void |
registerAcceptableFlower(net.minecraft.block.Block block,
java.lang.String... flowerTypes)
Registers an accepted flower with any state.
|
void |
registerAcceptableFlower(net.minecraft.block.state.IBlockState blockState,
java.lang.String... flowerTypes)
Registers an accepted flower with a particular state.
|
void |
registerAcceptableFlowerRule(IFlowerAcceptableRule acceptableFlower,
java.lang.String... flowerTypes)
Registers custom logic for accepted flowers.
|
void |
registerGrowthRule(IFlowerGrowthRule rule,
java.lang.String... flowerTypes)
Register a new flower growth rule.
|
void |
registerPlantableFlower(net.minecraft.block.state.IBlockState blockState,
double weight,
java.lang.String... flowerTypes)
Registers a plantable flower.
|
public void registerAcceptableFlower(net.minecraft.block.Block block,
java.lang.String... flowerTypes)
IFlowerRegistryregisterAcceptableFlower in interface IFlowerRegistrypublic void registerAcceptableFlower(net.minecraft.block.state.IBlockState blockState,
java.lang.String... flowerTypes)
IFlowerRegistryregisterAcceptableFlower in interface IFlowerRegistrypublic void registerAcceptableFlowerRule(IFlowerAcceptableRule acceptableFlower, java.lang.String... flowerTypes)
IFlowerRegistryregisterAcceptableFlowerRule in interface IFlowerRegistrypublic void registerPlantableFlower(net.minecraft.block.state.IBlockState blockState,
double weight,
java.lang.String... flowerTypes)
IFlowerRegistryregisterPlantableFlower in interface IFlowerRegistryweight - Weight for the Flower (Vanilla = 1.0, Modded flowers < 1.0)flowerTypes - See FlowerManager.FlowerTypeXXXpublic java.util.List<net.minecraft.util.math.BlockPos> getAcceptedFlowerCoordinates(IBeeHousing beeHousing, IBee bee, java.lang.String flowerType, int maxFlowers)
getAcceptedFlowerCoordinates in interface IFlowerRegistrybeeHousing - The bee housing that will help determine the size of the area to check.bee - The bee that will help determine the size of the area to check.flowerType - See FlowerManager.FlowerTypeXXXmaxFlowers - the largest number of flowers to check for before returning. Use 1 if you only need 1.public java.util.Iterator<net.minecraft.util.math.BlockPos.MutableBlockPos> getAreaIterator(IBeeHousing beeHousing, IBee bee)
IFlowerRegistrygetAreaIterator in interface IFlowerRegistrybeeHousing - The bee housing that will help determine the size of the area to check.bee - The bee that will help determine the size of the area to check.@Deprecated
public boolean isAcceptedFlower(java.lang.String flowerType,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
IFlowerRegistryisAcceptedFlower in interface IFlowerRegistrypublic IBlockPosPredicate createAcceptedFlowerPredicate(java.lang.String flowerType)
IFlowerRegistrycreateAcceptedFlowerPredicate in interface IFlowerRegistry@Deprecated
public boolean growFlower(java.lang.String flowerType,
net.minecraft.world.World world,
IIndividual individual,
net.minecraft.util.math.BlockPos pos)
IFlowerRegistrygrowFlower in interface IFlowerRegistrypublic boolean growFlower(java.lang.String flowerType,
net.minecraft.world.World world,
IIndividual individual,
net.minecraft.util.math.BlockPos pos,
java.util.Collection<net.minecraft.block.state.IBlockState> potentialFlowers)
IFlowerRegistrygrowFlower in interface IFlowerRegistrypublic void registerGrowthRule(IFlowerGrowthRule rule, java.lang.String... flowerTypes)
IFlowerRegistryregisterGrowthRule in interface IFlowerRegistry@Nullable public Flower getRandomPlantableFlower(java.lang.String flowerType, java.util.Random rand)
public boolean plantRandomFlower(java.lang.String flowerType,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
IFlowerGrowthHelperplantRandomFlower in interface IFlowerGrowthHelperpublic boolean plantRandomFlower(java.lang.String flowerType,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
java.util.Collection<net.minecraft.block.state.IBlockState> potentialFlowers)
IFlowerGrowthHelperplantRandomFlower in interface IFlowerGrowthHelperflowerType - the flower type that can be plantedworld - the world to plant flowers inpos - the position to plant the flowerspotentialFlowers - the potential flowers that can be planted