Package forestry.api.apiculture
Interface IActivityType
- All Superinterfaces:
IRegistryAlleleValue
Used to define the active hours of a bee.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longgetBeeDayTime(net.minecraft.world.level.LevelAccessor level) Used to determine the time of day for a beehive.getInactiveError(long gameTime, long dayTime, net.minecraft.core.BlockPos pos) Gets the error to display in GUIs for when this bee is inactive.Whether a bee only works above light level 11, less than or equal to that, or doesn't care.booleanisActive(long gameTime, long dayTime, net.minecraft.core.BlockPos pos) Determines whether this bee can be active and work at the current time of day.Methods inherited from interface forestry.api.genetics.alleles.IRegistryAlleleValue
isDominant
-
Field Details
-
NIGHT_TIME
static final long NIGHT_TIME- Since:
- 2.6.1 The hardcoded time used to represent night time.
- See Also:
-
-
Method Details
-
isActive
boolean isActive(long gameTime, long dayTime, net.minecraft.core.BlockPos pos) Determines whether this bee can be active and work at the current time of day.- Parameters:
gameTime- The number of ticks spent in the current level. SeeLevelData.getGameTime().dayTime- The time of day of the current level, can be above 24000. SeegetBeeDayTime(net.minecraft.world.level.LevelAccessor).pos- The hive position. It can be used for randomness, like how flowers are offset based on position.- Returns:
trueif this bee should be able to work,falseif this bee should be asleep.- See Also:
-
getInactiveError
Gets the error to display in GUIs for when this bee is inactive. This method is only called whenisActive(long, long, net.minecraft.core.BlockPos)returns false for the given parameters, so no need to duplicate your time checks.- Parameters:
gameTime- The number of ticks spent in the current level. SeeLevelData.getGameTime().dayTime- The time of day of the current level, can be above 24000. SeegetBeeDayTime(net.minecraft.world.level.LevelAccessor).pos- The hive position. It can be used for randomness, like how flowers are offset based on position.- Returns:
- A descriptive error indicating that the time of day is wrong for this bee.
-
getLightPreference
LightPreference getLightPreference()Whether a bee only works above light level 11, less than or equal to that, or doesn't care. For example, Diurnal bees want to work when the hive is above light level 11, but nocturnal bees will only work when the light level is 11 or below.- Returns:
- The preference of light level for this activity type.
-
getBeeDayTime
static long getBeeDayTime(net.minecraft.world.level.LevelAccessor level) Used to determine the time of day for a beehive. This takes dimensions without time, such as the Nether, into account.- Parameters:
level- The level to query time for.- Returns:
- The time, adjusted to
NIGHT_TIMEfor dimensions without a daytime cycle. - Since:
- 2.6.1
-