Interface ServerWorldProperties
- All Superinterfaces:
DataHolder, DataHolder.Mutable, GameRuleHolder, Identifiable, Keyed, Nameable, ResourceKeyed, ValueContainer, WeatherUniverse, WeatherUniverse.Mutable, WorldProperties
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCustomize the load process of aServerWorldProperties.Nested classes/interfaces inherited from interface DataHolder
DataHolder.Immutable<I>, DataHolder.MutableNested classes/interfaces inherited from interface 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) Deprecated, for removal: This API element is subject to removal in a future version.voidsetWanderingTraderSpawnChance(int chance) Deprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.default voidsetWorldType(WorldType worldType) Sets theWorldType.default intGets the view distance.intDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.default Weatherweather()Deprecated, for removal: This API element is subject to removal in a future version.world()Gets theServerWorldthat correlates to this properties, if available.default WorldArchetypedefault WorldArchetypeTypedefault WorldBorderGets the savedWorldBorderfor this world.default WorldGenerationConfigGets theWorldGenerationConfigdefault WorldTypeGets theWorldType.Methods inherited from interface 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 GameRuleHolder
gameRule, gameRules, setGameRuleMethods inherited from interface Identifiable
uniqueIdMethods inherited from interface ResourceKeyed
keyMethods inherited from interface ValueContainer
get, getDouble, getInt, getKeys, getLong, getOrElse, getOrNull, getValue, getValues, require, requireValue, streamKeys, streamValues, supports, supportsMethods inherited from interface WeatherUniverse.Mutable
setWeather, setWeatherMethods inherited from interface 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
-
setDisplayName
-
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
-
setWorldType
-
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
-
setGameMode
-
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
Deprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version.Sets the delay before aWanderingTraderwill be spawned.- Parameters:
delay- The delay, in ticks
-
wanderingTraderSpawnChance
Deprecated, for removal: This API element is subject to removal in a future version.Gets the chance that aWanderingTraderwill be spawned, as a percentageIn vanilla Minecraft, 25% is the default chance
- Returns:
- The delay, as a percentage
-
setWanderingTraderSpawnChance
Deprecated, for removal: This API element is subject to removal in a future version.Sets the chance that aWanderingTraderwill be spawned.- Parameters:
chance- The chance, as a percentage
-
wanderTraderUniqueId
Deprecated, for removal: This API element is subject to removal in a future version.Gets theunique idof theWanderingTraderthat has been spawned.- Returns:
- The unique id or
Optional.empty()if one has not been spawned
-
setWanderingTrader
@Deprecated(forRemoval=true, since="19.0") void setWanderingTrader(@Nullable WanderingTrader trader) Deprecated, for removal: This API element is subject to removal in a future version.Sets theWanderingTrader.In vanilla Minecraft, this will become the spawned trader.
- Parameters:
trader- The trader
-
customBossBars
-
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
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:WeatherUniverseGets the currentWeathertaking place in this volume.- Specified by:
weatherin interfaceWeatherUniverse- Returns:
- The current weather.
-
worldArchetypeType
-
worldArchetype
-