Package forestry.api.apiculture
Interface IActivityType
public interface IActivityType
Used to define the active hours of a bee.
- See Also:
-
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.boolean
-
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
-
isDominant
boolean isDominant()- Returns:
- Whether the allele for this value is dominant or recessive.
-
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 a normal day cycle into account.Dimensions without skylight, like the Nether, use
NIGHT_TIME. Dimensions with a fixed time, like the Twilight Forest, use that fixed time. Every other dimension uses the day time of the level.- Parameters:
level- The level to query time for.- Returns:
- The time of day used to determine bee activity
-