Interface IActivityType

All Superinterfaces:
IRegistryAlleleValue

public interface IActivityType extends IRegistryAlleleValue
Used to define the active hours of a bee.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.

    Methods inherited from interface forestry.api.genetics.alleles.IRegistryAlleleValue

    isDominant
  • 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. See LevelData.getGameTime().
      dayTime - The time of day of the current level, can be above 24000. See LevelData.getDayTime().
      pos - The hive position. It can be used for randomness, like how flowers are offset based on position.
      Returns:
      true if this bee should be able to work, false if this bee should be asleep.
      See Also:
    • getInactiveError

      IError getInactiveError(long gameTime, long dayTime, net.minecraft.core.BlockPos pos)
      Gets the error to display in GUIs for when this bee is inactive. This method is only called when isActive(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. See LevelData.getGameTime().
      dayTime - The time of day of the current level, can be above 24000. See LevelData.getDayTime().
      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.