Interface ServerWorldProperties

All Superinterfaces:
DataHolder, DataHolder.Mutable, GameRuleHolder, Identifiable, Keyed, Nameable, ResourceKeyed, ValueContainer, WeatherUniverse, WeatherUniverse.Mutable, WorldProperties

public interface ServerWorldProperties extends WorldProperties, GameRuleHolder, Nameable, Identifiable, ResourceKeyed, WeatherUniverse.Mutable
  • Method Details

    • world

      Gets the ServerWorld that correlates to this properties, if available.

      The rules are that the world must be loaded and it's ServerWorld.key() matches this properties' ResourceKeyed.key(). Lastly, the properties of that world and this properties must be reference equal.

      Returns:
      The world or Optional.empty() otherwise
    • displayName

      default Optional<Component> displayName()
      Gets the name.
      Returns:
      The name
    • setDisplayName

      default void setDisplayName(@Nullable Component name)
      Sets the name.
      Parameters:
      name - The name
    • initialized

      default boolean initialized()
      Gets if this has been initialized.
      Returns:
      Is initialized
    • loadOnStartup

      default boolean loadOnStartup()
      Gets whether this world will load when the server starts up.
      Returns:
      Load on startup
    • setLoadOnStartup

      default void setLoadOnStartup(boolean loadOnStartup)
      Sets whether this should load when the server starts up.
      Parameters:
      loadOnStartup - Load on startup
    • performsSpawnLogic

      default boolean performsSpawnLogic()
      Gets whether logic surrounding a spawn position is performed.

      It is up to the implementation on how this setting is handled. For Vanilla Minecraft, the following occurs:

      • If the world is new, a spawn point is calculated
      • The chunks around the spawn point within a radius are kept loaded in memory
      Returns:
      performs spawn logic
    • setPerformsSpawnLogic

      default void setPerformsSpawnLogic(boolean performsSpawnLogic)
      Sets whether logic surrounding a spawn position is performed.

      It is up to the implementation on how this setting is handled. For Vanilla Minecraft, the following occurs:

      • If the world is new, a spawn point is calculated
      • The chunks around the spawn point within a radius are kept loaded in memory
      Parameters:
      performsSpawnLogic - Performs spawn logic
    • worldGenerationConfig

      default WorldGenerationConfig worldGenerationConfig()
      Returns:
      The world generation settings
    • setDayTime

      void setDayTime(MinecraftDayTime time)
      Sets the in-game time of day.
      Parameters:
      time - The time of day
    • worldType

      default WorldType worldType()
      Gets the WorldType.
      Returns:
      The world type
    • setWorldType

      default void setWorldType(WorldType worldType)
      Sets the WorldType.
      Parameters:
      worldType - the type
    • pvp

      default boolean pvp()
      Gets whether PVP combat is enabled.
      Returns:
      pvp
    • setPvp

      default void setPvp(boolean pvp)
      Sets whether PVP combat is enabled.
      Parameters:
      pvp - pvp
    • gameMode

      default GameMode gameMode()
      Gets the default GameMode.
      Returns:
      The game mode
    • setGameMode

      default void setGameMode(GameMode gameMode)
      Sets the GameMode.
      Parameters:
      gameMode - game mode
    • setHardcore

      default void setHardcore(boolean hardcore)
      Sets if this is in hardcore mode.
      Parameters:
      hardcore - hardcore
    • commands

      default boolean commands()
      Gets whether commands are enabled.

      It is up to the implementation to determine how this is respected.

      Returns:
      Commands
    • setCommands

      default void setCommands(boolean commands)
      Sets whether commands are enabled.

      It is up to the implementation to determine how this is respected.

      Parameters:
      commands - commands
    • setDifficulty

      default void setDifficulty(Difficulty difficulty)
      Sets the Difficulty.
      Parameters:
      difficulty - The difficulty
    • serializationBehavior

      default SerializationBehavior serializationBehavior()
      Returns:
      Serialization behavior
    • setSerializationBehavior

      default void setSerializationBehavior(SerializationBehavior behavior)
      Parameters:
      behavior - serialization behavior
    • wanderingTraderSpawnDelay

      Ticks wanderingTraderSpawnDelay()
      Gets the delay before a WanderingTrader will be spawned, in ticks.

      In vanilla minecraft, 24,000 ticks is the default delay.

      Returns:
      The delay, in ticks
    • setWanderingTraderSpawnDelay

      void setWanderingTraderSpawnDelay(Ticks delay)
      Sets the delay before a WanderingTrader will be spawned.
      Parameters:
      delay - The delay, in ticks
    • wanderingTraderSpawnChance

      int wanderingTraderSpawnChance()
      Gets the chance that a WanderingTrader will be spawned, as a percentage

      In vanilla Minecraft, 25% is the default chance

      Returns:
      The delay, as a percentage
    • setWanderingTraderSpawnChance

      void setWanderingTraderSpawnChance(int chance)
      Sets the chance that a WanderingTrader will be spawned.
      Parameters:
      chance - The chance, as a percentage
    • wanderTraderUniqueId

      Optional<UUID> wanderTraderUniqueId()
      Gets the unique id of the WanderingTrader that has been spawned.
      Returns:
      The unique id or Optional.empty() if one has not been spawned
    • setWanderingTrader

      void setWanderingTrader(@Nullable WanderingTrader trader)
      Sets the WanderingTrader.

      In vanilla Minecraft, this will become the spawned trader.

      Parameters:
      trader - The trader
    • customBossBars

      List<KeyedValue<BossBar>> customBossBars()
      Gets the custom bars.
      Returns:
      The boss bars
    • setCustomBossBars

      void setCustomBossBars(@Nullable List<KeyedValue<BossBar>> bars)
      Sets the custom bars.
      Parameters:
      bars - The boss bars
    • viewDistance

      default int viewDistance()
      Gets the view distance.

      In Vanilla Minecraft, this is in units of chunks and is considered the radius. Consult your specific implementation vendor for further details.

      Returns:
      View distance
    • setViewDistance

      default void setViewDistance(@Nullable Integer viewDistance)
      Sets the view distance (in chunks).

      In Vanilla Minecraft, this is in units of chunks and is considered the radius. Additionally it must be greater than 3 and less than or equal to 32.

      Consult your specific implementation vendor for further details.

      Parameters:
      viewDistance - The view distance
    • worldBorder

      default WorldBorder worldBorder()
      Gets the saved WorldBorder for this world.
      Returns:
      The world border
    • weather

      default Weather weather()
      Description copied from interface: WeatherUniverse
      Gets the current Weather taking place in this volume.
      Specified by:
      weather in interface WeatherUniverse
      Returns:
      The current weather.