Class VoidEventResource

java.lang.Object
com.hypixel.hytale.builtin.portals.resources.VoidEventResource
All Implemented Interfaces:
Resource<EntityStore>, Cloneable

public class VoidEventResource extends Object implements Resource<EntityStore>
Tracks the void-event of a portal world. The schedule drives the void-event stages and the HUD breach mode.

The schedule is anchored to the world's TimeResource clock. Unlike the instance timeout timer, the anchor never moves when players win back portal time. Stages therefore always trigger at their configured second of the world's lifetime.

  • Field Details

  • Constructor Details

    • VoidEventResource

      public VoidEventResource()
  • Method Details

    • getResourceType

      @Nonnull public static ResourceType<EntityStore, VoidEventResource> getResourceType()
    • start

      public void start(@Nonnull Instant now, double elapsedSeconds)
      Starts the schedule at the given elapsed time, if it has not started yet. While paused, the anchor derives from the pause instant, so the schedule stays frozen at that elapsed time.
    • isStarted

      public boolean isStarted()
    • getElapsedSeconds

      public double getElapsedSeconds(@Nonnull Instant now)
      How many seconds of the world's lifetime the schedule has covered. While paused, the value is frozen at the pause instant.
    • hasReached

      public boolean hasReached(@Nonnull Instant now, int secondsInto)
      Whether the schedule has reached the given second of the world's lifetime. While paused, the schedule is frozen at the pause instant.
    • pause

      public void pause(@Nonnull Instant now)
      Freezes the schedule at the given instant.
    • resume

      public void resume(@Nonnull Instant now)
      Unfreezes the schedule. The anchor shifts forward by the pause duration, so the remaining stages still trigger after the same amount of active time.
    • reset

      public void reset()
      Discards the schedule so it re-derives from the current elapsed time. Only for admin/debug commands that jump the timer. Gameplay time adjustments must never move the schedule.
    • clone

      @Nonnull public VoidEventResource clone()
      Specified by:
      clone in interface Resource<EntityStore>
      Returns:
      a clone instance of the original resource instance.