Class TimeCondition

java.lang.Object
com.hypixel.hytale.builtin.adventure.worldevents.condition.TimeCondition
All Implemented Interfaces:
EventCondition, EventCondition.Ticking

public class TimeCondition extends Object implements EventCondition.Ticking
  • Field Details

  • Constructor Details

    • TimeCondition

      public TimeCondition()
  • Method Details

    • test

      public boolean test()
      Description copied from interface: EventCondition
      Returns true when this condition has been satisfied.

      This method is called frequently and must be side-effect free. Update internal state in EventCondition.Ticking.tick(float, Store) or EventCondition.Event.handle(World, T) instead.

      Specified by:
      test in interface EventCondition
      Returns:
      true if the condition is met
    • reset

      public void reset()
      Description copied from interface: EventCondition
      Resets the condition to its unsatisfied state before a new stage iteration begins.

      Called before EventCondition.onStart(WorldEvent) at the start of a stage. All transient fields (timers, flags, cached context references) should be cleared here.

      Specified by:
      reset in interface EventCondition
    • tick

      public void tick(float dt, @Nonnull Store<EntityStore> store)
      Description copied from interface: EventCondition.Ticking
      Updates the condition's internal state.

      Set a flag or update a counter here; do not call EventCondition.test() from within this method. The manager reads EventCondition.test() after tick returns.

      Specified by:
      tick in interface EventCondition.Ticking
      Parameters:
      dt - elapsed seconds since the last tick dispatch for this condition type
      store - the entity store for the world the condition is running in
    • merge

      public void merge(@Nonnull EventCondition other)
      Description copied from interface: EventCondition
      Copies runtime state from other into this condition.

      Called when a persisted condition is restored from storage. The (this) condition is built from its asset config, and the loaded state from the (other) condition is merged into it.

      Specified by:
      merge in interface EventCondition
      Parameters:
      other - the loaded condition to merge state from.