Interface ServerWorldProperties
- All Superinterfaces:
DataHolder
,DataHolder.Mutable
,GameRuleHolder
,Identifiable
,Keyed
,Nameable
,ResourceKeyed
,ValueContainer
,WeatherUniverse
,WeatherUniverse.Mutable
,WorldProperties
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
Nested classes/interfaces inherited from interface org.spongepowered.api.world.weather.WeatherUniverse
WeatherUniverse.Mutable
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
commands()
Gets whether commands are enabled.Gets the custombars
.Gets thename
.default GameMode
gameMode()
Gets the defaultGameMode
.default boolean
Gets if this has been initialized.default boolean
Gets whether this world will load when the server starts up.default boolean
Gets whether logic surrounding aspawn position
is performed.default boolean
pvp()
Gets whether PVP combat is enabled.default SerializationBehavior
Gets theSerializationBehavior
.default void
setCommands
(boolean commands) Sets whether commands are enabled.void
setCustomBossBars
(@Nullable List<KeyedValue<BossBar>> bars) Sets the custombars
.void
setDayTime
(MinecraftDayTime time) Sets the in-game time of day.default void
setDifficulty
(Difficulty difficulty) Sets theDifficulty
.default void
setDisplayName
(@Nullable Component name) Sets thename
.default void
setGameMode
(GameMode gameMode) Sets theGameMode
.default void
setHardcore
(boolean hardcore) Sets if this is in hardcore mode.default void
setLoadOnStartup
(boolean loadOnStartup) Sets whether this should load when the server starts up.default void
setPerformsSpawnLogic
(boolean performsSpawnLogic) Sets whether logic surrounding aspawn position
is performed.default void
setPvp
(boolean pvp) Sets whether PVP combat is enabled.default void
Sets theSerializationBehavior
.default void
setViewDistance
(@Nullable Integer viewDistance) Sets the view distance (in chunks).void
setWanderingTrader
(@Nullable WanderingTrader trader) Sets theWanderingTrader
.void
setWanderingTraderSpawnChance
(int chance) Sets the chance that aWanderingTrader
will be spawned.void
Sets the delay before aWanderingTrader
will be spawned.default void
setWorldType
(WorldType worldType) Sets theWorldType
.default int
Gets the view distance.int
Gets the chance that aWanderingTrader
will be spawned, as a percentageGets the delay before aWanderingTrader
will be spawned, in ticks.Gets theunique id
of theWanderingTrader
that has been spawned.default Weather
weather()
Gets the currentWeather
taking place in this volume.world()
Gets theServerWorld
that correlates to this properties, if available.default WorldBorder
Gets the savedWorldBorder
for this world.default WorldGenerationConfig
Gets theWorldGenerationConfig
default WorldType
Gets theWorldType
.Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undo
Methods inherited from interface org.spongepowered.api.world.gamerule.GameRuleHolder
gameRule, gameRules, setGameRule
Methods inherited from interface org.spongepowered.api.util.Identifiable
uniqueId
Methods inherited from interface org.spongepowered.api.ResourceKeyed
key
Methods inherited from interface org.spongepowered.api.data.value.ValueContainer
get, getDouble, getInt, getKeys, getLong, getOrElse, getOrNull, getValue, getValues, require, requireValue, supports, supports
Methods inherited from interface org.spongepowered.api.world.weather.WeatherUniverse.Mutable
setWeather, setWeather
Methods inherited from interface org.spongepowered.api.world.storage.WorldProperties
dayTime, difficulty, gameTime, hardcore, setSpawnPosition, spawnPosition
-
Method Details
-
world
Optional<ServerWorld> world()Gets theServerWorld
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
Gets thename
.- Returns:
- The name
-
setDisplayName
Sets thename
.- 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 aspawn 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 aspawn 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
Gets theWorldGenerationConfig
- Returns:
- The world generation settings
-
setDayTime
Sets the in-game time of day.- Parameters:
time
- The time of day
-
worldType
Gets theWorldType
.- Returns:
- The world type
-
setWorldType
Sets theWorldType
.- 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
Gets the defaultGameMode
.- Returns:
- The game mode
-
setGameMode
Sets theGameMode
.- 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
Sets theDifficulty
.- Parameters:
difficulty
- The difficulty
-
serializationBehavior
Gets theSerializationBehavior
.- Returns:
- Serialization behavior
-
setSerializationBehavior
Sets theSerializationBehavior
.- Parameters:
behavior
- serialization behavior
-
wanderingTraderSpawnDelay
Ticks wanderingTraderSpawnDelay()Gets the delay before aWanderingTrader
will be spawned, in ticks.In vanilla minecraft, 24,000 ticks is the default delay.
- Returns:
- The delay, in ticks
-
setWanderingTraderSpawnDelay
Sets the delay before aWanderingTrader
will be spawned.- Parameters:
delay
- The delay, in ticks
-
wanderingTraderSpawnChance
int wanderingTraderSpawnChance()Gets the chance that aWanderingTrader
will be spawned, as a percentageIn vanilla Minecraft, 25% is the default chance
- Returns:
- The delay, as a percentage
-
setWanderingTraderSpawnChance
void setWanderingTraderSpawnChance(int chance) Sets the chance that aWanderingTrader
will be spawned.- Parameters:
chance
- The chance, as a percentage
-
wanderTraderUniqueId
Gets theunique id
of theWanderingTrader
that has been spawned.- Returns:
- The unique id or
Optional.empty()
if one has not been spawned
-
setWanderingTrader
Sets theWanderingTrader
.In vanilla Minecraft, this will become the spawned trader.
- Parameters:
trader
- The trader
-
customBossBars
List<KeyedValue<BossBar>> customBossBars()Gets the custombars
.- Returns:
- The boss bars
-
setCustomBossBars
Sets the custombars
.- 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
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
Gets the savedWorldBorder
for this world.- Returns:
- The world border
-
weather
Description copied from interface:WeatherUniverse
Gets the currentWeather
taking place in this volume.- Specified by:
weather
in interfaceWeatherUniverse
- Returns:
- The current weather.
-