Interface Server
- All Superinterfaces:
Audience, ForwardingAudience, Pointered
-
Nested Class Summary
Nested classes/interfaces inherited from interface ForwardingAudience
ForwardingAudience.Single -
Method Summary
Modifier and TypeMethodDescriptioncommands()createWorld(WorldBuilder spec) Creates a new world from the given specification.default WorldcreateWorld(Key key, WorldGenerator generator) Gets the server description shown in the status ping.voiddescription(Component description) Sets the server description shown in the status ping.events()favicon()Gets the server's favicon shown in the status ping.voidSets the server's favicon shown in the status ping.getName()Gets the server name.booleanintGets the maximum player count shown in the status ping.voidmaxPlayers(int maxPlayers) Sets the maximum player count shown in the status ping.Collection<? extends Player> Gets the server-wide permission registry.intGets the current online player count.plugins()intservices()voidshutdown()booleanunloadWorld(Key key, boolean save) Unloads the world identified bykey, optionally saving it to disk first.Collection<? extends World> worlds()Methods inherited from interface Audience
deleteMessage, openBook, openBook, removeResourcePacks, removeResourcePacks, removeResourcePacks, sendActionBar, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, showTitle, stopSoundMethods inherited from interface ForwardingAudience
audiences, clearResourcePacks, clearTitle, closeDialog, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, playSound, playSound, playSound, pointers, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendTitlePart, showBossBar, showDialog, stopSoundMethods inherited from interface Pointered
get, getOrDefault, getOrDefaultFrom
-
Method Details
-
getName
-
minecraftVersion
String minecraftVersion() -
protocolVersion
int protocolVersion() -
scheduler
RegionizedScheduler scheduler() -
commands
CommandRegistry commands() -
events
EventBus events() -
favicon
-
favicon
Sets the server's favicon shown in the status ping.- Parameters:
favicon- the server favicon- Since:
- 0.1.0
-
description
Gets the server description shown in the status ping.- Returns:
- server description
- Since:
- 0.1.0
-
description
Sets the server description shown in the status ping.- Parameters:
description- server description- Since:
- 0.1.0
-
maxPlayers
@Contract(pure=true) int maxPlayers()Gets the maximum player count shown in the status ping.- Returns:
- maximum player count
- Since:
- 0.1.0
-
maxPlayers
@Contract(mutates="this") void maxPlayers(int maxPlayers) Sets the maximum player count shown in the status ping.- Parameters:
maxPlayers- maximum player count- Since:
- 0.1.0
-
playerCount
@Contract(pure=true) int playerCount()Gets the current online player count.- Returns:
- online player count
- Since:
- 0.1.0
-
services
ServiceRegistry services() -
plugins
PluginManager plugins() -
permissions
PermissionRegistry permissions()Gets the server-wide permission registry.- Returns:
- the permission registry
- Since:
- 0.1.0
-
worlds
Collection<? extends World> worlds() -
world
-
createWorld
Creates a new world from the given specification.If a world is already registered under the spec's key, that existing world is returned unchanged and the rest of the spec (seed, generator) is ignored; this call is therefore idempotent with respect to the world key. Otherwise a new world is registered using the spec's generator, or the server's built-in default generator when the spec supplies none.
The returned world is immediately usable: it participates in ticking and its chunks are generated on demand through the configured generator.
- Parameters:
spec- the description of the world to create- Returns:
- the newly created world, or the existing world sharing the same key
- Since:
- 0.1.0
-
createWorld
- Parameters:
key- the world keygenerator- the chunk generator to drive the new world- Returns:
- the newly created world, or the existing world sharing the same key
- Since:
- 0.1.0
-
unloadWorld
Unloads the world identified bykey, optionally saving it to disk first.Unloading removes the world from
worlds()and stops it being ticked; entities it held are released. The call is refused, returningfalsewithout side effects, when:- no world is registered under
key; - the world is the server's primary world, which must always remain loaded; or
- players are still present in the world — relocate them with another world first.
- Parameters:
key- the key of the world to unloadsave- whether to save the world before unloading it- Returns:
trueif the world was unloaded,falseif the call was refused- Since:
- 0.1.0
- no world is registered under
-
onlinePlayers
Collection<? extends Player> onlinePlayers() -
player
-
player
-
offlinePlayers
-
isRunning
boolean isRunning() -
shutdown
void shutdown() -
translationStore
TranslationStore translationStore()
-