Interface Server
- All Superinterfaces:
Audience, ForwardingAudience, Pointered
-
Nested Class Summary
Nested classes/interfaces inherited from interface ForwardingAudience
ForwardingAudience.Single -
Method Summary
Modifier and TypeMethodDescriptionban()Gets the service holding the players who are not allowed to connect.biomes()Gets the server-wide biome registry.Gets the server brand name.commands()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.dialogs()Gets the server-wide dialog registry.Gets the server-wide dimension type registry.events()favicon()Gets the server's favicon shown in the status ping.voidSets the server's favicon shown in the status ping.booleanitems()Gets the server-wide item registry.intGets the maximum player count shown in the status ping.voidmaxPlayers(int maxPlayers) Sets the maximum player count shown in the status ping.mobs()Gets the server-wide mob registry.Collection<? extends Player> Gets the server-wide permission registry.intGets the current online player count.plugins()intservices()voidshutdown()Datapack structures: packs of<world>/datapacks, templates, jigsaw structures, placement and/locate-style search.booleanunloadWorld(Key key, boolean save) Unloads the world identified bykey, optionally saving it to disk first.Gets the service holding the players allowed to connect while the whitelist is enforced.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
-
brandName
Gets the server brand name.- Returns:
- server brand name
- Since:
- 0.1.0
-
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
-
ban
Gets the service holding the players who are not allowed to connect.- Returns:
- the ban service
- Since:
- 0.1.0
-
whitelist
Gets the service holding the players allowed to connect while the whitelist is enforced.- Returns:
- the whitelist service
- 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
-
dialogs
Gets the server-wide dialog registry.- Returns:
- the dialog registry
- Since:
- 0.1.0
-
biomes
Gets the server-wide biome registry.Biomes registered there are sent to every client joining afterwards, and may be referenced by
generatorsthroughGeneratedChunk.setBiome(int, int, int, Key).- Returns:
- the biome registry
- Since:
- 0.1.0
-
dimensionTypes
DimensionTypeRegistry dimensionTypes()Gets the server-wide dimension type registry.Dimension types registered there are sent to every client joining afterwards, and may be referenced by
generatorsthroughGeneratedChunk.setBiome(int, int, int, Key).- Returns:
- the biome registry
- Since:
- 0.1.0
-
mobs
Gets the server-wide mob registry.Where plugins attach behaviours to the built-in mobs, and register mobs of their own.
- Returns:
- the mob registry
- Since:
- 0.1.0
-
items
Gets the server-wide item registry.Where plugins register items of their own, rendered client-side as the vanilla item they name.
- Returns:
- the item registry
- Since:
- 0.1.0
-
worlds
Collection<? extends World> worlds() -
structures
StructureManager structures()Datapack structures: packs of<world>/datapacks, templates, jigsaw structures, placement and/locate-style search.- Returns:
- the structure manager of the server
- Since:
- 0.1.0
-
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()
-