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.MutableNested classes/interfaces inherited from interface org.spongepowered.api.world.weather.WeatherUniverse
WeatherUniverse.Mutable -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancommands()Gets whether commands are enabled.Gets the custombars.Gets thename.default GameModegameMode()Gets the defaultGameMode.default booleanGets if this has been initialized.default booleanGets whether this world will load when the server starts up.default booleanGets whether logic surrounding aspawn positionis performed.default booleanpvp()Gets whether PVP combat is enabled.default SerializationBehaviorGets theSerializationBehavior.default voidsetCommands(boolean commands) Sets whether commands are enabled.voidsetCustomBossBars(@Nullable List<KeyedValue<BossBar>> bars) Sets the custombars.voidsetDayTime(MinecraftDayTime time) Sets the in-game time of day.default voidsetDifficulty(Difficulty difficulty) Sets theDifficulty.default voidsetDisplayName(@Nullable Component name) Sets thename.default voidsetGameMode(GameMode gameMode) Sets theGameMode.default voidsetHardcore(boolean hardcore) Sets if this is in hardcore mode.default voidsetLoadOnStartup(boolean loadOnStartup) Sets whether this should load when the server starts up.default voidsetPerformsSpawnLogic(boolean performsSpawnLogic) Sets whether logic surrounding aspawn positionis performed.default voidsetPvp(boolean pvp) Sets whether PVP combat is enabled.default voidSets theSerializationBehavior.default voidsetViewDistance(@Nullable Integer viewDistance) Sets the view distance (in chunks).voidsetWanderingTrader(@Nullable WanderingTrader trader) Sets theWanderingTrader.voidsetWanderingTraderSpawnChance(int chance) Sets the chance that aWanderingTraderwill be spawned.voidSets the delay before aWanderingTraderwill be spawned.default voidsetWorldType(WorldType worldType) Sets theWorldType.default intGets the view distance.intGets the chance that aWanderingTraderwill be spawned, as a percentageGets the delay before aWanderingTraderwill be spawned, in ticks.Gets theunique idof theWanderingTraderthat has been spawned.default Weatherweather()Gets the currentWeathertaking place in this volume.world()Gets theServerWorldthat correlates to this properties, if available.default WorldBorderGets the savedWorldBorderfor this world.default WorldGenerationConfigGets theWorldGenerationConfigdefault WorldTypeGets 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, undoMethods inherited from interface org.spongepowered.api.world.gamerule.GameRuleHolder
gameRule, gameRules, setGameRuleMethods inherited from interface org.spongepowered.api.util.Identifiable
uniqueIdMethods inherited from interface org.spongepowered.api.ResourceKeyed
keyMethods inherited from interface org.spongepowered.api.data.value.ValueContainer
get, getDouble, getInt, getKeys, getLong, getOrElse, getOrNull, getValue, getValues, require, requireValue, supports, supportsMethods inherited from interface org.spongepowered.api.world.weather.WeatherUniverse.Mutable
setWeather, setWeatherMethods inherited from interface org.spongepowered.api.world.storage.WorldProperties
dayTime, difficulty, gameTime, hardcore, setSpawnPosition, spawnPosition
-
Method Details
-
world
Optional<ServerWorld> world()Gets theServerWorldthat 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 positionis 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 positionis 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 aWanderingTraderwill be spawned, in ticks.In vanilla minecraft, 24,000 ticks is the default delay.
- Returns:
- The delay, in ticks
-
setWanderingTraderSpawnDelay
Sets the delay before aWanderingTraderwill be spawned.- Parameters:
delay- The delay, in ticks
-
wanderingTraderSpawnChance
int wanderingTraderSpawnChance()Gets the chance that aWanderingTraderwill 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 aWanderingTraderwill be spawned.- Parameters:
chance- The chance, as a percentage
-
wanderTraderUniqueId
Gets theunique idof theWanderingTraderthat 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 savedWorldBorderfor this world.- Returns:
- The world border
-
weather
Description copied from interface:WeatherUniverseGets the currentWeathertaking place in this volume.- Specified by:
weatherin interfaceWeatherUniverse- Returns:
- The current weather.
-