Class PortalWorld

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

public class PortalWorld extends Object implements Resource<EntityStore>
  • Field Details

  • Constructor Details

    • PortalWorld

      public PortalWorld()
  • Method Details

    • init

      public void init(@Nonnull World world, @Nonnull PortalType portalType, int timeLimitSeconds, @Nonnull PortalRemovalCondition removalCondition, @Nonnull PortalGameplayConfig gameplayConfig, int allowedEntryCount)
    • getPortalType

      @Nullable public PortalType getPortalType()
    • exists

      public boolean exists()
    • getTimeLimitSeconds

      public int getTimeLimitSeconds()
    • hasTimeLimit

      public boolean hasTimeLimit()
    • isVoidInvasionEnabled

      public boolean isVoidInvasionEnabled()
    • getElapsedSeconds

      public double getElapsedSeconds(@Nonnull World world)
    • getRemainingSeconds

      public double getRemainingSeconds(@Nonnull World world)
    • getAllowedEntryCount

      public int getAllowedEntryCount()
    • isAllowPlayersToLeaveViaMap

      public boolean isAllowPlayersToLeaveViaMap()
    • getEntryCount

      public int getEntryCount(@Nonnull UUID playerId)
    • hasAnyEntry

      public boolean hasAnyEntry()
    • recordEntry

      public int recordEntry(@Nonnull UUID playerId)
    • hasReachedEntryLimit

      public boolean hasReachedEntryLimit(@Nonnull UUID playerId)
    • getSeesUi

      public Set<UUID> getSeesUi()
    • isTimeLimitActive

      public boolean isTimeLimitActive()
    • toggleTimeLimit

      public boolean toggleTimeLimit(@Nonnull World world)
    • computeLatestStage

      @Nullable public VoidEventStage computeLatestStage(@Nonnull World world, @Nonnull VoidEventConfig config)
      Calculate the latest active void event stage for the given world and event configuration.
    • hasVoidEventReached

      public boolean hasVoidEventReached(@Nonnull World world, int secondsInto)
      Whether the void-event has reached the given second of the world's lifetime.
    • getActiveVoidEventStage

      @Nullable public VoidEventStage getActiveVoidEventStage(@Nonnull Store<EntityStore> store)
      The active void-event stage, or null when no void event runs or no stage has started yet.
    • getActiveInvasionPortals

      @Nullable public InvasionPortalConfig getActiveInvasionPortals(@Nonnull Store<EntityStore> store)
      The invasion-portal config in effect for the active void-event stage, or null when no portal world exists, no stage is active, or no stage so far defines invasion portals.
    • getGameplayConfig

      public PortalGameplayConfig getGameplayConfig()
    • getVoidEventConfig

      @Nullable public VoidEventConfig getVoidEventConfig()
    • getSpawnPoint

      @Nullable public Transform getSpawnPoint()
    • setSpawnPoint

      public void setSpawnPoint(Transform spawnPoint)
    • getVoidEventRef

      @Nullable public Ref<EntityStore> getVoidEventRef()
    • isVoidEventActive

      public boolean isVoidEventActive()
    • setVoidEventRef

      public void setVoidEventRef(@Nullable Ref<EntityStore> voidEventRef)
    • createFullPacket

      @Nonnull public UpdatePortal createFullPacket(@Nonnull World world)
    • createUpdatePacket

      @Nonnull public UpdatePortal createUpdatePacket(@Nonnull World world)
    • clone

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

    • getResourceType

      public static ResourceType<EntityStore, PortalWorld> getResourceType()
    • setRemainingSeconds

      public static void setRemainingSeconds(@Nonnull World world, double seconds, boolean resyncSchedule)