Class CloudServer

java.lang.Object
org.cloudburstmc.server.CloudServer
All Implemented Interfaces:
org.cloudburstmc.api.Server

public class CloudServer extends Object implements org.cloudburstmc.api.Server
Author:
MagicDroidX, Box
  • Field Details

    • networkCompressionLevel

      public int networkCompressionLevel
  • Constructor Details

    • CloudServer

      public CloudServer(Path dataPath, Path pluginPath, Path levelPath, String predefinedLanguage)
  • 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

      public int broadcastMessage(String message)
    • 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

      public int broadcast(String message, String permissions)
    • broadcast

      public int broadcast(org.cloudburstmc.api.locale.TextContainer message, String permissions)
    • broadcastPacket

      public static void broadcastPacket(Set<CloudPlayer> players, com.nukkitx.protocol.bedrock.BedrockPacket packet)
    • boot

      public void boot() throws IOException
      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

      public ConsoleCommandSender getConsoleSender()
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface org.cloudburstmc.api.Server
    • forceShutdown

      public void forceShutdown()
    • start

      public void start()
    • handlePacket

      public void handlePacket(InetSocketAddress address, io.netty.buffer.ByteBuf payload)
    • tickProcessor

      public void tickProcessor()
    • onPlayerCompleteLoginSequence

      public void onPlayerCompleteLoginSequence(org.cloudburstmc.api.player.Player player)
      Specified by:
      onPlayerCompleteLoginSequence in interface org.cloudburstmc.api.Server
    • onPlayerLogin

      public void onPlayerLogin(org.cloudburstmc.api.player.Player player)
    • addPlayer

      public void addPlayer(InetSocketAddress socketAddress, org.cloudburstmc.api.player.Player player)
    • addOnlinePlayer

      public void addOnlinePlayer(org.cloudburstmc.api.player.Player player)
      Specified by:
      addOnlinePlayer in interface org.cloudburstmc.api.Server
    • removeOnlinePlayer

      public void removeOnlinePlayer(org.cloudburstmc.api.player.Player player)
    • updatePlayerListData

      public void updatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin)
    • updatePlayerListData

      public void updatePlayerListData(UUID uuid, long entityId, String name, com.nukkitx.protocol.bedrock.data.skin.SerializedSkin skin, String xboxUserId)
    • 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

      public void removePlayerListData(UUID uuid)
    • removePlayerListData

      public void removePlayerListData(UUID uuid, CloudPlayer[] players)
    • removePlayerListData

      public void removePlayerListData(UUID uuid, Collection<CloudPlayer> players)
    • sendFullPlayerListData

      public void sendFullPlayerListData(CloudPlayer player)
    • 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

      public String getName()
      Specified by:
      getName in interface org.cloudburstmc.api.Server
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.cloudburstmc.api.Server
    • getImplementationVersion

      public String getImplementationVersion()
      Specified by:
      getImplementationVersion in interface org.cloudburstmc.api.Server
    • getVersion

      public String getVersion()
      Specified by:
      getVersion in interface org.cloudburstmc.api.Server
    • getApiVersion

      public String getApiVersion()
      Specified by:
      getApiVersion in interface org.cloudburstmc.api.Server
    • getFilePath

      public Path getFilePath()
    • getDataPath

      public Path getDataPath()
    • getPluginPath

      public Path getPluginPath()
    • getMaxPlayers

      public int getMaxPlayers()
      Specified by:
      getMaxPlayers in interface org.cloudburstmc.api.Server
    • setMaxPlayers

      public void setMaxPlayers(int maxPlayers)
    • getPort

      public int getPort()
      Specified by:
      getPort in interface org.cloudburstmc.api.Server
    • getViewDistance

      public int getViewDistance()
    • getIp

      public String getIp()
      Specified by:
      getIp in interface org.cloudburstmc.api.Server
    • getServerUniqueId

      public UUID getServerUniqueId()
    • getAutoSave

      public boolean getAutoSave()
    • setAutoSave

      public void setAutoSave(boolean autoSave)
      Specified by:
      setAutoSave in interface org.cloudburstmc.api.Server
    • getGenerateStructures

      public boolean getGenerateStructures()
    • getGamemode

      public org.cloudburstmc.api.player.GameMode getGamemode()
      Specified by:
      getGamemode in interface org.cloudburstmc.api.Server
    • getForceGamemode

      public boolean getForceGamemode()
    • getDifficulty

      public org.cloudburstmc.api.level.Difficulty getDifficulty()
      Specified by:
      getDifficulty in interface org.cloudburstmc.api.Server
    • hasWhitelist

      public boolean hasWhitelist()
      Specified by:
      hasWhitelist in interface org.cloudburstmc.api.Server
    • getSpawnRadius

      public int getSpawnRadius()
    • getAllowFlight

      public boolean getAllowFlight()
      Specified by:
      getAllowFlight in interface org.cloudburstmc.api.Server
    • isHardcore

      public boolean isHardcore()
    • getDefaultGamemode

      public org.cloudburstmc.api.player.GameMode getDefaultGamemode()
    • getMotd

      public String getMotd()
      Specified by:
      getMotd in interface org.cloudburstmc.api.Server
    • getSubMotd

      public String getSubMotd()
    • getForceResources

      public boolean getForceResources()
    • getEventManager

      public CloudEventManager getEventManager()
      Specified by:
      getEventManager in interface org.cloudburstmc.api.Server
    • getPluginManager

      public CloudPluginManager getPluginManager()
      Specified by:
      getPluginManager in interface org.cloudburstmc.api.Server
    • getPermissionManager

      public CloudPermissionManager getPermissionManager()
      Specified by:
      getPermissionManager in interface org.cloudburstmc.api.Server
    • getCraftingManager

      public CraftingManager getCraftingManager()
    • getPackManager

      public PackManager getPackManager()
    • getScheduler

      public ServerScheduler getScheduler()
    • getTick

      public int getTick()
      Specified by:
      getTick in interface org.cloudburstmc.api.Server
    • getTicksPerSecond

      public float getTicksPerSecond()
    • getTicksPerSecondAverage

      public float getTicksPerSecondAverage()
    • getTickUsage

      public float getTickUsage()
    • getTickUsageAverage

      public float getTickUsageAverage()
    • getCommandRegistry

      public CommandRegistry getCommandRegistry()
    • getOnlinePlayers

      public Map<UUID,​CloudPlayer> getOnlinePlayers()
      Specified by:
      getOnlinePlayers in interface org.cloudburstmc.api.Server
    • addRecipe

      public void addRecipe(org.cloudburstmc.api.inventory.Recipe recipe)
    • getPlayer

      public Optional<org.cloudburstmc.api.player.Player> getPlayer(UUID uuid)
    • lookupName

      public Optional<UUID> lookupName(String name)
    • updateName

      public void updateName(UUID uuid, String name)
    • getOfflinePlayer

      public org.cloudburstmc.api.player.Player getOfflinePlayer(UUID uuid)
    • getOfflinePlayerData

      public com.nukkitx.nbt.NbtMap getOfflinePlayerData(UUID uuid)
    • getOfflinePlayerData

      public com.nukkitx.nbt.NbtMap getOfflinePlayerData(UUID uuid, boolean create)
    • getOfflinePlayerData

      @Deprecated public com.nukkitx.nbt.NbtMap getOfflinePlayerData(String name)
      Deprecated.
    • getOfflinePlayerData

      @Deprecated public com.nukkitx.nbt.NbtMap getOfflinePlayerData(String name, boolean create)
      Deprecated.
    • saveOfflinePlayerData

      public void saveOfflinePlayerData(UUID uuid, com.nukkitx.nbt.NbtMap tag)
    • saveOfflinePlayerData

      public void saveOfflinePlayerData(String name, com.nukkitx.nbt.NbtMap tag)
    • saveOfflinePlayerData

      public void saveOfflinePlayerData(UUID uuid, com.nukkitx.nbt.NbtMap tag, boolean async)
    • saveOfflinePlayerData

      public void saveOfflinePlayerData(String name, com.nukkitx.nbt.NbtMap tag, boolean async)
    • getPlayer

      public org.cloudburstmc.api.player.Player getPlayer(String name)
      Specified by:
      getPlayer in interface org.cloudburstmc.api.Server
    • getPlayerExact

      public CloudPlayer getPlayerExact(String name)
    • matchPlayer

      public org.cloudburstmc.api.player.Player[] matchPlayer(String partialName)
    • removePlayer

      public void removePlayer(org.cloudburstmc.api.player.Player player)
    • getLevels

      public Set<CloudLevel> getLevels()
    • getDefaultLevel

      public CloudLevel getDefaultLevel()
      Specified by:
      getDefaultLevel in interface org.cloudburstmc.api.Server
    • setDefaultLevel

      public void setDefaultLevel(CloudLevel level)
    • isLevelLoaded

      public boolean isLevelLoaded(String name)
    • getLevel

      public CloudLevel getLevel(String id)
    • getLevelByName

      public CloudLevel getLevelByName(String name)
    • unloadLevel

      public boolean unloadLevel(CloudLevel level)
    • unloadLevel

      public boolean unloadLevel(CloudLevel level, boolean forceUnload)
    • loadLevel

      public LevelBuilder loadLevel()
    • getLanguage

      public LocaleManager getLanguage()
    • isLanguageForced

      public boolean isLanguageForced()
    • getNetwork

      public Network getNetwork()
    • getConfig

      public ServerConfig getConfig()
    • getNameBans

      public BanList getNameBans()
    • getIPBans

      public BanList getIPBans()
    • isBanned

      public boolean isBanned(org.cloudburstmc.api.player.Player player)
      Specified by:
      isBanned in interface org.cloudburstmc.api.Server
    • isIPBanned

      public boolean isIPBanned(org.cloudburstmc.api.player.Player player)
      Specified by:
      isIPBanned in interface org.cloudburstmc.api.Server
    • setBanned

      public void setBanned(org.cloudburstmc.api.player.Player who, boolean banned, boolean byIP)
      Specified by:
      setBanned in interface org.cloudburstmc.api.Server
    • addOp

      public void addOp(org.cloudburstmc.api.player.Player who)
      Specified by:
      addOp in interface org.cloudburstmc.api.Server
    • addOp

      public void addOp(String name)
      Specified by:
      addOp in interface org.cloudburstmc.api.Server
    • removeOp

      public void removeOp(org.cloudburstmc.api.player.Player who)
      Specified by:
      removeOp in interface org.cloudburstmc.api.Server
    • removeOp

      public void removeOp(String name)
      Specified by:
      removeOp in interface org.cloudburstmc.api.Server
    • addWhitelist

      public void addWhitelist(org.cloudburstmc.api.player.Player player)
      Specified by:
      addWhitelist in interface org.cloudburstmc.api.Server
    • addWhitelist

      public void addWhitelist(String name)
    • removeWhitelist

      public void removeWhitelist(org.cloudburstmc.api.player.Player player)
      Specified by:
      removeWhitelist in interface org.cloudburstmc.api.Server
    • removeWhitelist

      public void removeWhitelist(String name)
    • isWhitelisted

      public boolean isWhitelisted(org.cloudburstmc.api.player.Player player)
      Specified by:
      isWhitelisted in interface org.cloudburstmc.api.Server
    • isWhitelisted

      public boolean isWhitelisted(String name)
    • isOp

      public boolean isOp(org.cloudburstmc.api.player.Player player)
      Specified by:
      isOp in interface org.cloudburstmc.api.Server
    • isOp

      public boolean isOp(String name)
    • getWhitelist

      public Config getWhitelist()
    • getOps

      public Config getOps()
    • reloadWhitelist

      public void reloadWhitelist()
    • getCommandAliases

      public Map<String,​List<String>> 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

      public Thread getPrimaryThread()
    • isNetherAllowed

      public boolean isNetherAllowed()
    • getPlayerDataSerializer

      public org.cloudburstmc.api.util.PlayerDataSerializer getPlayerDataSerializer()
    • setPlayerDataSerializer

      public void setPlayerDataSerializer(org.cloudburstmc.api.util.PlayerDataSerializer playerDataSerializer)
    • getLevelManager

      public LevelManager getLevelManager()
    • getDefaultLevelData

      public LevelData getDefaultLevelData()
    • getDefaultStorageId

      public org.cloudburstmc.api.util.Identifier getDefaultStorageId()
    • getStorageRegistry

      public StorageRegistry getStorageRegistry()
    • getGameRuleRegistry

      public CloudGameRuleRegistry getGameRuleRegistry()
      Specified by:
      getGameRuleRegistry in interface org.cloudburstmc.api.Server
    • getBlockRegistry

      public CloudBlockRegistry getBlockRegistry()
    • getItemRegistry

      public org.cloudburstmc.api.registry.ItemRegistry getItemRegistry()
    • getRecipeRegistry

      public org.cloudburstmc.api.registry.RecipeRegistry getRecipeRegistry()
    • getGeneratorRegistry

      public GeneratorRegistry getGeneratorRegistry()
    • getBaseTickRate

      public int getBaseTickRate()
    • getAutoTickRateLimit

      public int getAutoTickRateLimit()
    • isAutoTickRate

      public boolean isAutoTickRate()
    • getInstance

      public static CloudServer getInstance()
    • isIgnoredPacket

      public boolean isIgnoredPacket(Class<? extends com.nukkitx.protocol.bedrock.BedrockPacket> clazz)