Class InstanceWorldConfig

java.lang.Object
com.hypixel.hytale.builtin.instances.config.InstanceWorldConfig

public class InstanceWorldConfig extends Object
The configuration for instance worlds, providing settings specific to instances.
  • Field Details

  • Constructor Details

    • InstanceWorldConfig

      public InstanceWorldConfig()
  • Method Details

    • get

      @Nullable public static InstanceWorldConfig get(@Nonnull WorldConfig config)
      Gets the InstanceWorldConfig from the given WorldConfig, or null if not present.
      Parameters:
      config - The world config.
      Returns:
      the instance world config, or null if not present.
    • ensureAndGet

      @Nonnull public static InstanceWorldConfig ensureAndGet(@Nonnull WorldConfig config)
      Ensures that the given WorldConfig has an InstanceWorldConfig and returns it.
      Parameters:
      config - The world config.
      Returns:
      the instance world config.
    • shouldPreventReconnection

      public boolean shouldPreventReconnection()
      Returns:
      true if players should be prevented from reconnecting into this instance, false otherwise.
    • shouldInheritWorldSettings

      public boolean shouldInheritWorldSettings()
      Returns:
      true if an instance inherits player defined world settings (e.g. fall damage, PvP) of the world it is entered from, false if it keeps the authored ones.
    • getRemovalConditions

      @Nonnull public RemovalCondition[] getRemovalConditions()
      Returns:
      the conditions that must be met for the instance to be removed.
    • setRemovalConditions

      public void setRemovalConditions(@Nonnull RemovalCondition... removalConditions)
      Called to set the removal conditions.
      Parameters:
      removalConditions - The removal conditions to set.
    • getReturnPoint

      @Nullable public WorldReturnPoint getReturnPoint()
      Returns:
      the return point for players leaving this instance.
    • setReturnPoint

      public void setReturnPoint(@Nullable WorldReturnPoint returnPoint)
      Called to set the return point.
      Parameters:
      returnPoint - The return point to set.
    • getDiscovery

      @Nullable public InstanceDiscoveryConfig getDiscovery()
      Returns:
      the discovery configuration for this instance, or null if no discovery is configured.
    • setDiscovery

      public void setDiscovery(@Nullable InstanceDiscoveryConfig discovery)
      Sets the discovery configuration for this instance.
      Parameters:
      discovery - The discovery configuration, or null to disable discovery.
    • shouldRespawnWhenTargeted

      public boolean shouldRespawnWhenTargeted()
      Returns:
      whether returns targeting a removed copy of this instance reuse a live copy or spawn a fresh one.
    • getInstanceKey

      @Nullable public String getInstanceKey()
      Returns:
      the fixed world key this instance's single copy lives under, or null for a copy per use.
    • getInstanceName

      @Nullable public String getInstanceName()
      Returns:
      the instance asset this world was spawned from, or null when not spawned as a copy.
    • setInstanceName

      public void setInstanceName(@Nullable String instanceName)
      Called by the spawn flow to record the instance asset this world was spawned from.
      Parameters:
      instanceName - The instance asset name.
    • getEventTitleOnRemoval

      @Nullable public EventTitleConfig getEventTitleOnRemoval()
      Returns:
      the event title to show while this instance closes, or null to close immediately.
    • setEventTitleOnRemoval

      public void setEventTitleOnRemoval(@Nullable EventTitleConfig eventTitleOnRemoval)
      Sets the event title to show while this instance closes.
      Parameters:
      eventTitleOnRemoval - The event title, or null to close immediately.
    • isEditMode

      public boolean isEditMode()
    • setEditMode

      public void setEditMode(boolean editMode)