Package org.cloudburstmc.server
Class CloudServer
java.lang.Object
org.cloudburstmc.server.CloudServer
- All Implemented Interfaces:
org.cloudburstmc.api.Server
- Author:
- MagicDroidX, Box
-
Field Summary
FieldsFields inherited from interface org.cloudburstmc.api.Server
BROADCAST_CHANNEL_ADMINISTRATIVE, BROADCAST_CHANNEL_USERS, JSON_MAPPER -
Constructor Summary
ConstructorsConstructorDescriptionCloudServer(Path dataPath, Path pluginPath, Path levelPath, String predefinedLanguage) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOnlinePlayer(org.cloudburstmc.api.player.Player player)voidvoidaddOp(org.cloudburstmc.api.player.Player who)voidaddPlayer(InetSocketAddress socketAddress, org.cloudburstmc.api.player.Player player)voidaddRecipe(org.cloudburstmc.api.crafting.Recipe recipe)voidaddWhitelist(String name)voidaddWhitelist(org.cloudburstmc.api.player.Player player)voidbatchPackets(org.cloudburstmc.api.player.Player[] players, com.nukkitx.protocol.bedrock.BedrockPacket[] packets)voidbatchPackets(org.cloudburstmc.api.player.Player[] players, com.nukkitx.protocol.bedrock.BedrockPacket[] packets, boolean forceSync)voidboot()intintintbroadcastMessage(String message)intbroadcastMessage(String message, Collection<? extends org.cloudburstmc.api.command.CommandSender> recipients)intbroadcastMessage(String message, org.cloudburstmc.api.command.CommandSender[] recipients)intbroadcastMessage(org.cloudburstmc.api.locale.TextContainer message)intbroadcastMessage(org.cloudburstmc.api.locale.TextContainer message, Collection<? extends org.cloudburstmc.api.command.CommandSender> recipients)static voidbroadcastPacket(Set<CloudPlayer> players, com.nukkitx.protocol.bedrock.BedrockPacket packet)static voidbroadcastPacket(org.cloudburstmc.api.player.Player[] players, com.nukkitx.protocol.bedrock.BedrockPacket packet)static voidbroadcastPackets(org.cloudburstmc.api.player.Player[] players, com.nukkitx.protocol.bedrock.BedrockPacket[] packets)booleandispatchCommand(org.cloudburstmc.api.command.CommandSender sender, String commandLine)voidvoidbooleanbooleanintintorg.cloudburstmc.api.player.GameModeorg.cloudburstmc.api.util.Identifierorg.cloudburstmc.api.level.Difficultybooleanbooleanorg.cloudburstmc.api.player.GameModebooleanstatic CloudServergetIp()org.cloudburstmc.api.registry.ItemRegistrygetLevelByName(String name)intgetMotd()getName()longorg.cloudburstmc.api.player.PlayergetOfflinePlayer(UUID uuid)com.nukkitx.nbt.NbtMapgetOfflinePlayerData(String name)Deprecated.com.nukkitx.nbt.NbtMapgetOfflinePlayerData(String name, boolean create)Deprecated.com.nukkitx.nbt.NbtMapgetOfflinePlayerData(UUID uuid)com.nukkitx.nbt.NbtMapgetOfflinePlayerData(UUID uuid, boolean create)getOps()org.cloudburstmc.api.player.PlayerOptional<org.cloudburstmc.api.player.Player>org.cloudburstmc.api.util.PlayerDataSerializergetPlayerExact(String name)intintgetPort()org.cloudburstmc.api.event.server.QueryRegenerateEventorg.cloudburstmc.api.registry.RecipeRegistryintintgetTick()floatfloatfloatfloatintvoidhandlePacket(InetSocketAddress address, io.netty.buffer.ByteBuf payload)booleanbooleanbooleanisBanned(org.cloudburstmc.api.player.Player player)booleanbooleanisIgnoredPacket(Class<? extends com.nukkitx.protocol.bedrock.BedrockPacket> clazz)booleanisIPBanned(org.cloudburstmc.api.player.Player player)booleanbooleanisLevelLoaded(String name)booleanbooleanbooleanisOp(org.cloudburstmc.api.player.Player player)booleanChecks the current thread against the expected primary thread for the server.booleanbooleanisWhitelisted(String name)booleanisWhitelisted(org.cloudburstmc.api.player.Player player)lookupName(String name)org.cloudburstmc.api.player.Player[]matchPlayer(String partialName)voidonPlayerCompleteLoginSequence(org.cloudburstmc.api.player.Player player)voidonPlayerLogin(org.cloudburstmc.api.player.Player player)voidvoidremoveOnlinePlayer(org.cloudburstmc.api.player.Player player)voidvoidremoveOp(org.cloudburstmc.api.player.Player who)voidremovePlayer(org.cloudburstmc.api.player.Player player)voidremovePlayerListData(UUID uuid)voidremovePlayerListData(UUID uuid, Collection<CloudPlayer> players)voidremovePlayerListData(UUID uuid, CloudPlayer[] players)voidremoveWhitelist(String name)voidremoveWhitelist(org.cloudburstmc.api.player.Player player)voidsaveOfflinePlayerData(String name, com.nukkitx.nbt.NbtMap tag)voidsaveOfflinePlayerData(String name, com.nukkitx.nbt.NbtMap tag, boolean async)voidsaveOfflinePlayerData(UUID uuid, com.nukkitx.nbt.NbtMap tag)voidsaveOfflinePlayerData(UUID uuid, com.nukkitx.nbt.NbtMap tag, boolean async)voidsendFullPlayerListData(CloudPlayer player)voidsendRecipeList(org.cloudburstmc.api.player.Player player)voidsetAutoSave(boolean autoSave)voidsetBanned(org.cloudburstmc.api.player.Player who, boolean banned, boolean byIP)voidsetDefaultLevel(CloudLevel level)voidsetMaxPlayers(int maxPlayers)voidsetPlayerDataSerializer(org.cloudburstmc.api.util.PlayerDataSerializer playerDataSerializer)booleanvoidshutdown()voidstart()voidvoidbooleanunloadLevel(CloudLevel level)booleanunloadLevel(CloudLevel level, boolean forceUnload)voidupdateName(UUID uuid, String name)voidupdatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin)voidupdatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin, String xboxUserId)voidupdatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin, String xboxUserId, Collection<CloudPlayer> players)voidupdatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin, String xboxUserId, CloudPlayer[] players)voidupdatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin, CloudPlayer[] players)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudburstmc.api.Server
ban, banIP, unban
-
Field Details
-
networkCompressionLevel
public int networkCompressionLevel
-
-
Constructor Details
-
CloudServer
-
-
Method Details
-
broadcastPackets
public static void broadcastPackets(org.cloudburstmc.api.player.Player[] players, com.nukkitx.protocol.bedrock.BedrockPacket[] packets) -
broadcastPacket
public static void broadcastPacket(org.cloudburstmc.api.player.Player[] players, com.nukkitx.protocol.bedrock.BedrockPacket packet) -
broadcastMessage
-
broadcastMessage
public int broadcastMessage(org.cloudburstmc.api.locale.TextContainer message) -
broadcastMessage
public int broadcastMessage(String message, org.cloudburstmc.api.command.CommandSender[] recipients) -
broadcastMessage
public int broadcastMessage(String message, Collection<? extends org.cloudburstmc.api.command.CommandSender> recipients) -
broadcastMessage
public int broadcastMessage(org.cloudburstmc.api.locale.TextContainer message, Collection<? extends org.cloudburstmc.api.command.CommandSender> recipients) -
broadcast
-
broadcast
-
broadcastPacket
public static void broadcastPacket(Set<CloudPlayer> players, com.nukkitx.protocol.bedrock.BedrockPacket packet) -
boot
- Throws:
IOException
-
batchPackets
public void batchPackets(org.cloudburstmc.api.player.Player[] players, com.nukkitx.protocol.bedrock.BedrockPacket[] packets) -
batchPackets
public void batchPackets(org.cloudburstmc.api.player.Player[] players, com.nukkitx.protocol.bedrock.BedrockPacket[] packets, boolean forceSync) -
dispatchCommand
public boolean dispatchCommand(org.cloudburstmc.api.command.CommandSender sender, String commandLine) throws org.cloudburstmc.api.ServerException- Throws:
org.cloudburstmc.api.ServerException
-
getConsoleSender
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceorg.cloudburstmc.api.Server
-
forceShutdown
public void forceShutdown() -
start
public void start() -
handlePacket
-
tickProcessor
public void tickProcessor() -
onPlayerCompleteLoginSequence
public void onPlayerCompleteLoginSequence(org.cloudburstmc.api.player.Player player)- Specified by:
onPlayerCompleteLoginSequencein interfaceorg.cloudburstmc.api.Server
-
onPlayerLogin
public void onPlayerLogin(org.cloudburstmc.api.player.Player player) -
addPlayer
-
addOnlinePlayer
public void addOnlinePlayer(org.cloudburstmc.api.player.Player player)- Specified by:
addOnlinePlayerin interfaceorg.cloudburstmc.api.Server
-
removeOnlinePlayer
public void removeOnlinePlayer(org.cloudburstmc.api.player.Player player) -
updatePlayerListData
-
updatePlayerListData
-
updatePlayerListData
public void updatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin, CloudPlayer[] players) -
updatePlayerListData
public void updatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin, String xboxUserId, CloudPlayer[] players) -
updatePlayerListData
public void updatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin, String xboxUserId, Collection<CloudPlayer> players) -
removePlayerListData
-
removePlayerListData
-
removePlayerListData
-
sendFullPlayerListData
-
sendRecipeList
public void sendRecipeList(org.cloudburstmc.api.player.Player player) -
doAutoSave
public void doAutoSave() -
getNextTick
public long getNextTick() -
titleTick
public void titleTick() -
getQueryInformation
public org.cloudburstmc.api.event.server.QueryRegenerateEvent getQueryInformation() -
getName
- Specified by:
getNamein interfaceorg.cloudburstmc.api.Server
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.cloudburstmc.api.Server
-
getImplementationVersion
- Specified by:
getImplementationVersionin interfaceorg.cloudburstmc.api.Server
-
getVersion
- Specified by:
getVersionin interfaceorg.cloudburstmc.api.Server
-
getApiVersion
- Specified by:
getApiVersionin interfaceorg.cloudburstmc.api.Server
-
getFilePath
-
getDataPath
-
getPluginPath
-
getMaxPlayers
public int getMaxPlayers()- Specified by:
getMaxPlayersin interfaceorg.cloudburstmc.api.Server
-
setMaxPlayers
public void setMaxPlayers(int maxPlayers) -
getPort
public int getPort()- Specified by:
getPortin interfaceorg.cloudburstmc.api.Server
-
getViewDistance
public int getViewDistance() -
getIp
- Specified by:
getIpin interfaceorg.cloudburstmc.api.Server
-
getServerUniqueId
-
getAutoSave
public boolean getAutoSave() -
setAutoSave
public void setAutoSave(boolean autoSave)- Specified by:
setAutoSavein interfaceorg.cloudburstmc.api.Server
-
getGenerateStructures
public boolean getGenerateStructures() -
getGamemode
public org.cloudburstmc.api.player.GameMode getGamemode()- Specified by:
getGamemodein interfaceorg.cloudburstmc.api.Server
-
getForceGamemode
public boolean getForceGamemode() -
getDifficulty
public org.cloudburstmc.api.level.Difficulty getDifficulty()- Specified by:
getDifficultyin interfaceorg.cloudburstmc.api.Server
-
hasWhitelist
public boolean hasWhitelist()- Specified by:
hasWhitelistin interfaceorg.cloudburstmc.api.Server
-
getSpawnRadius
public int getSpawnRadius() -
getAllowFlight
public boolean getAllowFlight()- Specified by:
getAllowFlightin interfaceorg.cloudburstmc.api.Server
-
isHardcore
public boolean isHardcore() -
getDefaultGamemode
public org.cloudburstmc.api.player.GameMode getDefaultGamemode() -
getMotd
- Specified by:
getMotdin interfaceorg.cloudburstmc.api.Server
-
getSubMotd
-
getForceResources
public boolean getForceResources() -
getEventManager
- Specified by:
getEventManagerin interfaceorg.cloudburstmc.api.Server
-
getPluginManager
- Specified by:
getPluginManagerin interfaceorg.cloudburstmc.api.Server
-
getPermissionManager
- Specified by:
getPermissionManagerin interfaceorg.cloudburstmc.api.Server
-
getCraftingManager
-
getPackManager
-
getScheduler
-
getTick
public int getTick()- Specified by:
getTickin interfaceorg.cloudburstmc.api.Server
-
getTicksPerSecond
public float getTicksPerSecond() -
getTicksPerSecondAverage
public float getTicksPerSecondAverage() -
getTickUsage
public float getTickUsage() -
getTickUsageAverage
public float getTickUsageAverage() -
getCommandRegistry
-
getOnlinePlayers
- Specified by:
getOnlinePlayersin interfaceorg.cloudburstmc.api.Server
-
addRecipe
public void addRecipe(org.cloudburstmc.api.crafting.Recipe recipe) -
getPlayer
-
lookupName
-
updateName
-
getOfflinePlayer
-
getOfflinePlayerData
-
getOfflinePlayerData
-
getOfflinePlayerData
Deprecated. -
getOfflinePlayerData
Deprecated. -
saveOfflinePlayerData
-
saveOfflinePlayerData
-
saveOfflinePlayerData
-
saveOfflinePlayerData
-
getPlayer
- Specified by:
getPlayerin interfaceorg.cloudburstmc.api.Server
-
getPlayerExact
-
matchPlayer
-
removePlayer
public void removePlayer(org.cloudburstmc.api.player.Player player) -
getLevels
-
getDefaultLevel
- Specified by:
getDefaultLevelin interfaceorg.cloudburstmc.api.Server
-
setDefaultLevel
-
isLevelLoaded
-
getLevel
-
getLevelByName
-
unloadLevel
-
unloadLevel
-
loadLevel
-
getLanguage
-
isLanguageForced
public boolean isLanguageForced() -
getNetwork
-
getConfig
-
getNameBans
-
getIPBans
-
isBanned
public boolean isBanned(org.cloudburstmc.api.player.Player player)- Specified by:
isBannedin interfaceorg.cloudburstmc.api.Server
-
isIPBanned
public boolean isIPBanned(org.cloudburstmc.api.player.Player player)- Specified by:
isIPBannedin interfaceorg.cloudburstmc.api.Server
-
setBanned
public void setBanned(org.cloudburstmc.api.player.Player who, boolean banned, boolean byIP)- Specified by:
setBannedin interfaceorg.cloudburstmc.api.Server
-
addOp
public void addOp(org.cloudburstmc.api.player.Player who)- Specified by:
addOpin interfaceorg.cloudburstmc.api.Server
-
addOp
- Specified by:
addOpin interfaceorg.cloudburstmc.api.Server
-
removeOp
public void removeOp(org.cloudburstmc.api.player.Player who)- Specified by:
removeOpin interfaceorg.cloudburstmc.api.Server
-
removeOp
- Specified by:
removeOpin interfaceorg.cloudburstmc.api.Server
-
addWhitelist
public void addWhitelist(org.cloudburstmc.api.player.Player player)- Specified by:
addWhitelistin interfaceorg.cloudburstmc.api.Server
-
addWhitelist
-
removeWhitelist
public void removeWhitelist(org.cloudburstmc.api.player.Player player)- Specified by:
removeWhitelistin interfaceorg.cloudburstmc.api.Server
-
removeWhitelist
-
isWhitelisted
public boolean isWhitelisted(org.cloudburstmc.api.player.Player player)- Specified by:
isWhitelistedin interfaceorg.cloudburstmc.api.Server
-
isWhitelisted
-
isOp
public boolean isOp(org.cloudburstmc.api.player.Player player)- Specified by:
isOpin interfaceorg.cloudburstmc.api.Server
-
isOp
-
getWhitelist
-
getOps
-
reloadWhitelist
public void reloadWhitelist() -
getCommandAliases
-
shouldSavePlayerData
public boolean shouldSavePlayerData() -
getPlayerSkinChangeCooldown
public int getPlayerSkinChangeCooldown() -
isPrimaryThread
public final boolean isPrimaryThread()Checks the current thread against the expected primary thread for the server.Note: this method should not be used to indicate the current synchronized state of the runtime. A current thread matching the main thread indicates that it is synchronized, but a mismatch does not preclude the same assumption.
- Returns:
- true if the current thread matches the expected primary thread, false otherwise
-
getPrimaryThread
-
isNetherAllowed
public boolean isNetherAllowed() -
getPlayerDataSerializer
public org.cloudburstmc.api.util.PlayerDataSerializer getPlayerDataSerializer() -
setPlayerDataSerializer
public void setPlayerDataSerializer(org.cloudburstmc.api.util.PlayerDataSerializer playerDataSerializer) -
getLevelManager
-
getDefaultLevelData
-
getDefaultStorageId
public org.cloudburstmc.api.util.Identifier getDefaultStorageId() -
getStorageRegistry
-
getGameRuleRegistry
- Specified by:
getGameRuleRegistryin interfaceorg.cloudburstmc.api.Server
-
getBlockRegistry
-
getItemRegistry
public org.cloudburstmc.api.registry.ItemRegistry getItemRegistry() -
getRecipeRegistry
public org.cloudburstmc.api.registry.RecipeRegistry getRecipeRegistry() -
getGeneratorRegistry
-
getBaseTickRate
public int getBaseTickRate() -
getAutoTickRateLimit
public int getAutoTickRateLimit() -
isAutoTickRate
public boolean isAutoTickRate() -
getInstance
-
isIgnoredPacket
-