Interface ServerWorldProperties
- All Superinterfaces:
- GameRuleHolder,- Identifiable,- Keyed,- Nameable,- ResourceKeyed,- WeatherUniverse,- WeatherUniverse.Mutable,- WorldProperties
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.spongepowered.api.world.weather.WeatherUniverseWeatherUniverse.Mutable
- 
Method SummaryModifier and TypeMethodDescriptionbooleancommands()Gets whether commands are enabled.Gets the custombars.Gets thename.gameMode()Gets the defaultGameMode.booleanGets if this has been initialized.booleanGets whether this world will load when the server starts up.booleanGets whether logic surrounding aspawn positionis performed.booleanpvp()Gets whether PVP combat is enabled.Gets theSerializationBehavior.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.voidsetDifficulty(Difficulty difficulty) Sets theDifficulty.voidsetDisplayName(@Nullable Component name) Sets thename.voidsetGameMode(GameMode gameMode) Sets theGameMode.voidsetHardcore(boolean hardcore) Sets if this is in hardcore mode.voidsetLoadOnStartup(boolean loadOnStartup) Sets whether this should load when the server starts up.voidsetPerformsSpawnLogic(boolean performsSpawnLogic) Sets whether logic surrounding aspawn positionis performed.voidsetPvp(boolean pvp) Sets whether PVP combat is enabled.voidSets theSerializationBehavior.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.voidsetWorldType(WorldType worldType) Sets theWorldType.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.world()Gets theServerWorldthat correlates to this properties, if available.Gets theWorldGenerationConfigGets theWorldType.Methods inherited from interface org.spongepowered.api.world.gamerule.GameRuleHoldergameRule, gameRules, setGameRuleMethods inherited from interface org.spongepowered.api.util.IdentifiableuniqueIdMethods inherited from interface org.spongepowered.api.ResourceKeyedkeyMethods inherited from interface org.spongepowered.api.world.weather.WeatherUniverseweatherMethods inherited from interface org.spongepowered.api.world.weather.WeatherUniverse.MutablesetWeather, setWeatherMethods inherited from interface org.spongepowered.api.world.storage.WorldPropertiesdayTime, difficulty, gameTime, hardcore, setSpawnPosition, spawnPosition, worldBorder
- 
Method Details- 
worldOptional<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
 
- 
displayNameGets thename.- Returns:
- The name
 
- 
setDisplayNameSets thename.- Parameters:
- name- The name
 
- 
initializedboolean initialized()Gets if this has been initialized.- Returns:
- Is initialized
 
- 
loadOnStartupboolean loadOnStartup()Gets whether this world will load when the server starts up.- Returns:
- Load on startup
 
- 
setLoadOnStartupvoid setLoadOnStartup(boolean loadOnStartup) Sets whether this should load when the server starts up.- Parameters:
- loadOnStartup- Load on startup
 
- 
performsSpawnLogicboolean 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
 
- 
setPerformsSpawnLogicvoid 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
 
- 
worldGenerationConfigWorldGenerationConfig.Mutable worldGenerationConfig()Gets theWorldGenerationConfig- Returns:
- The world generation settings
 
- 
setDayTimeSets the in-game time of day.- Parameters:
- time- The time of day
 
- 
worldTypeWorldType worldType()Gets theWorldType.- Returns:
- The world type
 
- 
setWorldTypeSets theWorldType.- Parameters:
- worldType- the type
 
- 
pvpboolean pvp()Gets whether PVP combat is enabled.- Returns:
- pvp
 
- 
setPvpvoid setPvp(boolean pvp) Sets whether PVP combat is enabled.- Parameters:
- pvp- pvp
 
- 
gameModeGameMode gameMode()Gets the defaultGameMode.- Returns:
- The game mode
 
- 
setGameModeSets theGameMode.- Parameters:
- gameMode- game mode
 
- 
setHardcorevoid setHardcore(boolean hardcore) Sets if this is in hardcore mode.- Parameters:
- hardcore- hardcore
 
- 
commandsboolean commands()Gets whether commands are enabled.It is up to the implementation to determine how this is respected. - Returns:
- Commands
 
- 
setCommandsvoid setCommands(boolean commands) Sets whether commands are enabled.It is up to the implementation to determine how this is respected. - Parameters:
- commands- commands
 
- 
setDifficultySets theDifficulty.- Parameters:
- difficulty- The difficulty
 
- 
serializationBehaviorSerializationBehavior serializationBehavior()Gets theSerializationBehavior.- Returns:
- Serialization behavior
 
- 
setSerializationBehaviorSets theSerializationBehavior.- Parameters:
- behavior- serialization behavior
 
- 
wanderingTraderSpawnDelayTicks 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
 
- 
setWanderingTraderSpawnDelaySets the delay before aWanderingTraderwill be spawned.- Parameters:
- delay- The delay, in ticks
 
- 
wanderingTraderSpawnChanceint wanderingTraderSpawnChance()Gets the chance that aWanderingTraderwill be spawned, as a percentageIn vanilla Minecraft, 25% is the default chance - Returns:
- The delay, as a percentage
 
- 
setWanderingTraderSpawnChancevoid setWanderingTraderSpawnChance(int chance) Sets the chance that aWanderingTraderwill be spawned.- Parameters:
- chance- The chance, as a percentage
 
- 
wanderTraderUniqueIdGets theunique idof theWanderingTraderthat has been spawned.- Returns:
- The unique id or Optional.empty()if one has not been spawned
 
- 
setWanderingTraderSets theWanderingTrader.In vanilla Minecraft, this will become the spawned trader. - Parameters:
- trader- The trader
 
- 
customBossBarsList<KeyedValue<BossBar>> customBossBars()Gets the custombars.- Returns:
- The boss bars
 
- 
setCustomBossBarsSets the custombars.- Parameters:
- bars- The boss bars
 
- 
viewDistanceint 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
 
- 
setViewDistanceSets 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
 
 
-