Package forestry.api.apiculture.hives
Interface IHivePlacement
public interface IHivePlacement
Determines placement conditions for a naturally generated wild beehive.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanReplace(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.WorldGenLevel level, 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, net.minecraft.util.RandomSource random, 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 level, net.minecraft.core.BlockPos pos) returns true if the hive can be generated at this location.
-
Method Details
-
getPosForHive
@Nullable net.minecraft.core.BlockPos getPosForHive(net.minecraft.world.level.WorldGenLevel level, net.minecraft.util.RandomSource random, int posX, int posZ) Determines the position of a hive.- Parameters:
level- The level to generate the hive in.random- 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 level, 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 state, net.minecraft.world.level.WorldGenLevel level, 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)
-