Package forestry.api.apiculture.hives
Interface IHiveGen
public interface IHiveGen
Determines placement conditions for a naturally generated wild beehive.
todo 1.21.1 rename to IHivePlacement
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanReplace(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.WorldGenLevel world, net.minecraft.core.BlockPos pos) returns true if the hive can safely replace the block at this location.net.minecraft.core.BlockPosgetPosForHive(net.minecraft.world.level.WorldGenLevel level, int posX, int posZ) Deprecated.default net.minecraft.core.BlockPosgetPosForHive(net.minecraft.world.level.WorldGenLevel level, net.minecraft.util.RandomSource rand, int posX, int posZ) Determines the position of a hive.static booleanisTreeBlock(net.minecraft.world.level.block.state.BlockState state) booleanisValidLocation(net.minecraft.world.level.WorldGenLevel world, net.minecraft.core.BlockPos pos) returns true if the hive can be generated at this location.
-
Method Details
-
getPosForHive
@Deprecated @Nullable net.minecraft.core.BlockPos getPosForHive(net.minecraft.world.level.WorldGenLevel level, int posX, int posZ) Deprecated.UsegetPosForHive(WorldGenLevel, RandomSource, int, int)with a world gen random instead. -
getPosForHive
@Nullable default net.minecraft.core.BlockPos getPosForHive(net.minecraft.world.level.WorldGenLevel level, net.minecraft.util.RandomSource rand, int posX, int posZ) Determines the position of a hive.- Parameters:
level- The level to generate the hive in.rand- The world generation random. Use this instead of the level random.posX- The X coordinate of the position where the hive should be generated.posZ- The Z coordinate of the position where the hive should be generated.- Returns:
- The position to place the hive at, or
nullif the hive can't generate at the given coordinates.
-
isValidLocation
boolean isValidLocation(net.minecraft.world.level.WorldGenLevel world, net.minecraft.core.BlockPos pos) returns true if the hive can be generated at this location. Used for advanced conditions, like checking that the ground below the hive is a certain type. -
canReplace
boolean canReplace(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.WorldGenLevel world, net.minecraft.core.BlockPos pos) returns true if the hive can safely replace the block at this location. -
isTreeBlock
static boolean isTreeBlock(net.minecraft.world.level.block.state.BlockState state)
-
getPosForHive(WorldGenLevel, RandomSource, int, int)with a world gen random instead.