Package net.glowstone

Class GlowServer

java.lang.Object
net.glowstone.GlowServer
All Implemented Interfaces:
net.kyori.adventure.audience.Audience, net.kyori.adventure.audience.ForwardingAudience, net.kyori.adventure.pointer.Pointered, org.bukkit.plugin.messaging.PluginMessageRecipient, org.bukkit.Server

public class GlowServer extends Object implements org.bukkit.Server
The core class of the Glowstone server.
  • Field Details

    • logger

      public static final Logger logger
      The logger for this class.
    • GAME_VERSION

      public static final String GAME_VERSION
      The game version supported by the server.
    • PROTOCOL_VERSION

      public static final int PROTOCOL_VERSION
      The protocol version supported by the server.
    • DATA_VERSION

      public static final int DATA_VERSION
      The data version supported by the server.
    • permissionRoot

      public org.bukkit.permissions.Permission permissionRoot
      Default root permissions.
    • permissionRootCommand

      public org.bukkit.permissions.Permission permissionRootCommand
      Default root command permissions.
  • Constructor Details

    • GlowServer

      public GlowServer(ServerConfig config)
      Creates a new server.
      Parameters:
      config - This server's config.
  • Method Details

    • main

      public static void main(String... args)
      Creates a new server on TCP port 25565 and starts listening for connections.
      Parameters:
      args - The command-line arguments.
    • createFromArguments

      public static GlowServer createFromArguments(String... args)
      Initialize a server using the command-line arguments.
      Parameters:
      args - the command-line arguments
      Returns:
      the new server, or null if the command-line arguments include e.g. --version
    • run

      public void run()
      Starts the server starting sequence (starting, binding to port, etc.)
    • start

      public void start()
      Starts this server.
    • shutdown

      public void shutdown()
      Stops this server.
      Specified by:
      shutdown in interface org.bukkit.Server
    • shutdown

      public void shutdown(String message)
      Stops this server, sending the specified message to all players on their kick screen.
      Parameters:
      message - Message to send to all players as they are kicked
    • getSpongePlugins

      public List<File> getSpongePlugins()
      A list of detected files that are Sponge plugins.
      Returns:
      a list of Files that are Sponge plugins.
    • reload

      public void reload()
      Reloads the server, refreshing settings and plugin information.
      Specified by:
      reload in interface org.bukkit.Server
    • reloadData

      public void reloadData()
      Specified by:
      reloadData in interface org.bukkit.Server
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCommandMap

      public org.bukkit.command.SimpleCommandMap getCommandMap()
      Gets the command map.
      Specified by:
      getCommandMap in interface org.bukkit.Server
      Returns:
      The SimpleCommandMap.
    • getAdvancement

      public org.bukkit.advancement.Advancement getAdvancement(org.bukkit.NamespacedKey namespacedKey)
      Specified by:
      getAdvancement in interface org.bukkit.Server
    • advancementIterator

      public Iterator<org.bukkit.advancement.Advancement> advancementIterator()
      Specified by:
      advancementIterator in interface org.bukkit.Server
    • createBlockData

      public org.bukkit.block.data.BlockData createBlockData(org.bukkit.Material material)
      Specified by:
      createBlockData in interface org.bukkit.Server
    • createBlockData

      public org.bukkit.block.data.BlockData createBlockData(org.bukkit.Material material, Consumer<org.bukkit.block.data.BlockData> consumer)
      Specified by:
      createBlockData in interface org.bukkit.Server
    • createBlockData

      public org.bukkit.block.data.BlockData createBlockData(String data) throws IllegalArgumentException
      Specified by:
      createBlockData in interface org.bukkit.Server
      Throws:
      IllegalArgumentException
    • createBlockData

      public org.bukkit.block.data.BlockData createBlockData(org.bukkit.Material material, String data) throws IllegalArgumentException
      Specified by:
      createBlockData in interface org.bukkit.Server
      Throws:
      IllegalArgumentException
    • getTag

      public <T extends org.bukkit.Keyed> org.bukkit.Tag<T> getTag(@NotNull @NotNull String registry, @NotNull @NotNull org.bukkit.NamespacedKey tagKey, @NotNull @NotNull Class<T> clazz)
      Specified by:
      getTag in interface org.bukkit.Server
    • getTags

      @NotNull public <T extends org.bukkit.Keyed> @NotNull Iterable<org.bukkit.Tag<T>> getTags(@NotNull @NotNull String registry, @NotNull @NotNull Class<T> clazz)
      Specified by:
      getTags in interface org.bukkit.Server
    • getLootTable

      public org.bukkit.loot.LootTable getLootTable(@NotNull @NotNull org.bukkit.NamespacedKey tableKey)
      Specified by:
      getLootTable in interface org.bukkit.Server
    • selectEntities

      @NotNull public @NotNull List<org.bukkit.entity.Entity> selectEntities(@NotNull @NotNull org.bukkit.command.CommandSender commandSender, @NotNull @NotNull String s) throws IllegalArgumentException
      Specified by:
      selectEntities in interface org.bukkit.Server
      Throws:
      IllegalArgumentException
    • getStructureManager

      @NotNull public @NotNull org.bukkit.structure.StructureManager getStructureManager()
      Specified by:
      getStructureManager in interface org.bukkit.Server
    • addAdvancement

      public void addAdvancement(org.bukkit.advancement.Advancement advancement)
      Registers an advancement to the advancement registry.
      Parameters:
      advancement - the advancement to add.
    • createAdvancementsMessage

      public AdvancementsMessage createAdvancementsMessage(boolean clear, List<org.bukkit.NamespacedKey> remove, org.bukkit.entity.Player player)
      Creates an AdvancementsMessage containing a list of advancements the server has, along with some extra actions.

      This does not affect the server's advancement registry.

      Parameters:
      clear - whether to clear the advancements on the player's perspective.
      remove - a list of advancement NamespacedKeys to remove from the player's perspective.
      player - the player this advancement message is for
      Returns:
      a resulting AdvancementsMessage packet
    • createAdvancementsMessage

      public AdvancementsMessage createAdvancementsMessage(Map<org.bukkit.NamespacedKey,org.bukkit.advancement.Advancement> advancements, boolean clear, List<org.bukkit.NamespacedKey> remove, org.bukkit.entity.Player player)
      Creates an AdvancementsMessage containing a given list of advancements, along with some extra actions.

      This does not affect the server's advancement registry.

      Parameters:
      advancements - the advancements to add to the player's perspective.
      clear - whether to clear the advancements on the player's perspective.
      remove - a list of advancement NamespacedKeys to remove from the player's perspective.
      player - the player this advancement message is for
      Returns:
      a resulting AdvancementsMessage packet
    • getSessionRegistry

      public SessionRegistry getSessionRegistry()
      Gets the session registry.
      Returns:
      The SessionRegistry.
    • getEntityIdManager

      public EntityIdManager getEntityIdManager()
      Gets the entity id manager.
      Returns:
      The EntityIdManager.
    • getOpsList

      public UuidListFile getOpsList()
      Returns the list of operators on this server.
      Returns:
      A file containing a list of UUIDs for this server's operators.
    • getWhitelist

      public UuidListFile getWhitelist()
      Returns the list of whitelisted players on this server.
      Returns:
      A file containing a list of UUIDs for this server's whitelisted players.
    • setWhitelist

      public void setWhitelist(boolean enabled)
      Specified by:
      setWhitelist in interface org.bukkit.Server
    • isWhitelistEnforced

      public boolean isWhitelistEnforced()
      Specified by:
      isWhitelistEnforced in interface org.bukkit.Server
    • setWhitelistEnforced

      public void setWhitelistEnforced(boolean value)
      Specified by:
      setWhitelistEnforced in interface org.bukkit.Server
    • getConfigDir

      public File getConfigDir()
      Returns the folder where configuration files are stored.
      Returns:
      The server's configuration folder.
    • getRecipeManager

      public net.glowstone.datapack.RecipeManager getRecipeManager()
      Return the recipe manager.
      Returns:
      The server's recipe manager.
    • getFuelManager

      public net.glowstone.datapack.FuelManager getFuelManager()
      Return the fuel manager.
      Returns:
      The server's fuel manager.
    • getKeyPair

      public KeyPair getKeyPair()
      The key pair generated at server start up.
      Returns:
      The key pair generated at server start up
    • getPlayerDataService

      public PlayerDataService getPlayerDataService()
      Returns the player data service attached to the first world.
      Returns:
      The server's player data service.
    • getScoreboardIoService

      public ScoreboardIoService getScoreboardIoService()
      Returns the scoreboard I/O service attached to the first world.
      Returns:
      The server's scoreboard I/O service
    • getPlayerStatisticIoService

      public PlayerStatisticIoService getPlayerStatisticIoService()
      Returns the player statistics I/O service attached to the first world.
      Returns:
      the server's statistics I/O service
    • getCompressionThreshold

      public int getCompressionThreshold()
      Get the threshold to use for network compression defined in the config.
      Returns:
      The compression threshold, or -1 for no compression.
    • getDifficulty

      public org.bukkit.Difficulty getDifficulty()
      Get the default game difficulty defined in the config.
      Returns:
      The default difficulty.
    • keepSpawnLoaded

      public boolean keepSpawnLoaded()
      Get whether worlds should keep their spawns loaded by default.
      Returns:
      Whether to keep spawns loaded by default.
    • populateAnchoredChunks

      public boolean populateAnchoredChunks()
      Get whether to populate chunks when they are anchored.
      Returns:
      Whether to populate chunks when they are anchored.
    • getProxySupport

      public boolean getProxySupport()
      Get whether parsing of data provided by a proxy is enabled.
      Returns:
      True if a proxy is providing data to use.
    • useRconColors

      public boolean useRconColors()
      Get whether to use color codes in Rcon responses.
      Returns:
      True if color codes will be present in Rcon responses
    • getMaterialValueManager

      public MaterialValueManager getMaterialValueManager()
      Gets the MaterialValueManager for this server.
      Returns:
      the MaterialValueManager for this server.
    • getResourcePackUrl

      public String getResourcePackUrl()
      Get the resource pack url for this server, or null if not set.
      Returns:
      The url of the resource pack to use, or null
    • getResourcePackHash

      public String getResourcePackHash()
      Get the resource pack hash for this server, or the empty string if not set.
      Specified by:
      getResourcePackHash in interface org.bukkit.Server
      Returns:
      The hash of the resource pack, or the empty string
    • getResourcePackPrompt

      @NotNull public @NotNull String getResourcePackPrompt()
      Specified by:
      getResourcePackPrompt in interface org.bukkit.Server
    • isResourcePackRequired

      public boolean isResourcePackRequired()
      Specified by:
      isResourcePackRequired in interface org.bukkit.Server
    • getProfileLookupTimeout

      public int getProfileLookupTimeout()
      Get the time after a profile lookup should be cancelled.
      Returns:
      The maximum lookup time in seconds or zero to never cancel the lookup.
    • setPlayerOnline

      public void setPlayerOnline(GlowPlayer player, boolean online)
      Sets a player as being online internally.
      Parameters:
      player - player to set online/offline
      online - whether the player is online or offline
    • getPluginsFolder

      @NotNull public @NotNull File getPluginsFolder()
      Specified by:
      getPluginsFolder in interface org.bukkit.Server
    • getName

      public String getName()
      Specified by:
      getName in interface org.bukkit.Server
    • getVersion

      public String getVersion()
      Specified by:
      getVersion in interface org.bukkit.Server
    • getBukkitVersion

      public String getBukkitVersion()
      Specified by:
      getBukkitVersion in interface org.bukkit.Server
    • getMinecraftVersion

      public String getMinecraftVersion()
      Specified by:
      getMinecraftVersion in interface org.bukkit.Server
    • getLogger

      public Logger getLogger()
      Specified by:
      getLogger in interface org.bukkit.Server
    • isPrimaryThread

      public boolean isPrimaryThread()
      Specified by:
      isPrimaryThread in interface org.bukkit.Server
    • getPluginManager

      public org.bukkit.plugin.PluginManager getPluginManager()
      Specified by:
      getPluginManager in interface org.bukkit.Server
    • getScheduler

      public GlowScheduler getScheduler()
      Specified by:
      getScheduler in interface org.bukkit.Server
    • getServicesManager

      public org.bukkit.plugin.ServicesManager getServicesManager()
      Specified by:
      getServicesManager in interface org.bukkit.Server
    • getMessenger

      public org.bukkit.plugin.messaging.Messenger getMessenger()
      Specified by:
      getMessenger in interface org.bukkit.Server
    • getHelpMap

      public org.bukkit.help.HelpMap getHelpMap()
      Specified by:
      getHelpMap in interface org.bukkit.Server
    • getItemFactory

      public org.bukkit.inventory.ItemFactory getItemFactory()
      Specified by:
      getItemFactory in interface org.bukkit.Server
    • getScoreboardManager

      public GlowScoreboardManager getScoreboardManager()
      Specified by:
      getScoreboardManager in interface org.bukkit.Server
    • getUnsafe

      @Deprecated public org.bukkit.UnsafeValues getUnsafe()
      Deprecated.
      Specified by:
      getUnsafe in interface org.bukkit.Server
    • spigot

      public org.bukkit.Server.Spigot spigot()
      Specified by:
      spigot in interface org.bukkit.Server
    • reloadPermissions

      public void reloadPermissions()
      Specified by:
      reloadPermissions in interface org.bukkit.Server
    • getEntity

      public org.bukkit.entity.Entity getEntity(UUID uuid)
      Specified by:
      getEntity in interface org.bukkit.Server
    • reloadCommandAliases

      public boolean reloadCommandAliases()
      Specified by:
      reloadCommandAliases in interface org.bukkit.Server
    • suggestPlayerNamesWhenNullTabCompletions

      public boolean suggestPlayerNamesWhenNullTabCompletions()
      Specified by:
      suggestPlayerNamesWhenNullTabCompletions in interface org.bukkit.Server
    • getPermissionMessage

      @NotNull public @NotNull String getPermissionMessage()
      Specified by:
      getPermissionMessage in interface org.bukkit.Server
    • permissionMessage

      @NotNull public @NotNull net.kyori.adventure.text.Component permissionMessage()
      Specified by:
      permissionMessage in interface org.bukkit.Server
    • createProfile

      public GlowPlayerProfile createProfile(UUID id)
      Specified by:
      createProfile in interface org.bukkit.Server
    • createProfile

      public GlowPlayerProfile createProfile(String name)
      Specified by:
      createProfile in interface org.bukkit.Server
    • createProfile

      public GlowPlayerProfile createProfile(UUID id, String name)
      Specified by:
      createProfile in interface org.bukkit.Server
    • createProfileExact

      public @NotNull com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable @Nullable UUID uuid, @Nullable @Nullable String name)
      Specified by:
      createProfileExact in interface org.bukkit.Server
    • createProfile

      public GlowPlayerProfile createProfile(UUID uuid, String name, boolean asyncLookup)
      Creates a player profile.
      Parameters:
      name - The player's name.
      uuid - The player's UUID; may be null.
      asyncLookup - If true and uuid is null, the UUID is looked up asynchronously.
      Returns:
      The player's profile.
    • getBanList

      public org.bukkit.BanList getBanList(org.bukkit.BanList.Type type)
      Specified by:
      getBanList in interface org.bukkit.Server
    • getConsoleSender

      public org.bukkit.command.ConsoleCommandSender getConsoleSender()
      Specified by:
      getConsoleSender in interface org.bukkit.Server
    • createCommandSender

      @NotNull public @NotNull org.bukkit.command.CommandSender createCommandSender(@NotNull @NotNull Consumer<? super net.kyori.adventure.text.Component> feedback)
      Specified by:
      createCommandSender in interface org.bukkit.Server
    • getPluginCommand

      public org.bukkit.command.PluginCommand getPluginCommand(String name)
      Specified by:
      getPluginCommand in interface org.bukkit.Server
    • getCommandAliases

      public Map<String,String[]> getCommandAliases()
      Specified by:
      getCommandAliases in interface org.bukkit.Server
    • dispatchCommand

      public boolean dispatchCommand(org.bukkit.command.CommandSender sender, String commandLine) throws org.bukkit.command.CommandException
      Specified by:
      dispatchCommand in interface org.bukkit.Server
      Throws:
      org.bukkit.command.CommandException
    • getOperators

      public Set<org.bukkit.OfflinePlayer> getOperators()
      Specified by:
      getOperators in interface org.bukkit.Server
    • getOnlinePlayers

      public Collection<? extends org.bukkit.entity.Player> getOnlinePlayers()
      Specified by:
      getOnlinePlayers in interface org.bukkit.Server
    • getRawOnlinePlayers

      public Collection<GlowPlayer> getRawOnlinePlayers()
      Gets the modifiable set of the server's online players.
      Returns:
      the server's modifiable set of players.
    • getOfflinePlayers

      public org.bukkit.OfflinePlayer[] getOfflinePlayers()
      Specified by:
      getOfflinePlayers in interface org.bukkit.Server
    • getOfflinePlayersAsync

      public CompletableFuture<org.bukkit.OfflinePlayer[]> getOfflinePlayersAsync()
      Gets every player that has ever played on this server.
      Returns:
      An OfflinePlayer[] future.
    • getPlayer

      public org.bukkit.entity.Player getPlayer(String name)
      Specified by:
      getPlayer in interface org.bukkit.Server
    • getPlayer

      public org.bukkit.entity.Player getPlayer(UUID uuid)
      Specified by:
      getPlayer in interface org.bukkit.Server
    • getPlayerUniqueId

      @Nullable public UUID getPlayerUniqueId(String playerName)
      Specified by:
      getPlayerUniqueId in interface org.bukkit.Server
    • getPlayerExact

      public org.bukkit.entity.Player getPlayerExact(String name)
      Specified by:
      getPlayerExact in interface org.bukkit.Server
    • matchPlayer

      public List<org.bukkit.entity.Player> matchPlayer(String name)
      Specified by:
      matchPlayer in interface org.bukkit.Server
    • getOfflinePlayer

      public org.bukkit.OfflinePlayer getOfflinePlayer(GlowPlayerProfile profile)
      Creates a new GlowOfflinePlayer instance for the given GlowPlayerProfile.
      Parameters:
      profile - the player's profile.
      Returns:
      a new GlowOfflinePlayer instance for the given profile.
    • getOfflinePlayer

      @Deprecated public org.bukkit.OfflinePlayer getOfflinePlayer(String name)
      Deprecated.
      Specified by:
      getOfflinePlayer in interface org.bukkit.Server
    • getOfflinePlayer

      public org.bukkit.OfflinePlayer getOfflinePlayer(UUID uuid)
      Specified by:
      getOfflinePlayer in interface org.bukkit.Server
    • createPlayerProfile

      @NotNull public @NotNull org.bukkit.profile.PlayerProfile createPlayerProfile(@Nullable @Nullable UUID uniqueId, @Nullable @Nullable String name)
      Specified by:
      createPlayerProfile in interface org.bukkit.Server
    • createPlayerProfile

      @NotNull public @NotNull org.bukkit.profile.PlayerProfile createPlayerProfile(@NotNull @NotNull UUID uniqueId)
      Specified by:
      createPlayerProfile in interface org.bukkit.Server
    • createPlayerProfile

      @NotNull public @NotNull org.bukkit.profile.PlayerProfile createPlayerProfile(@NotNull @NotNull String name)
      Specified by:
      createPlayerProfile in interface org.bukkit.Server
    • getOfflinePlayerIfCached

      public org.bukkit.OfflinePlayer getOfflinePlayerIfCached(@NotNull @NotNull String username)
      Specified by:
      getOfflinePlayerIfCached in interface org.bukkit.Server
    • getOfflinePlayerAsync

      public CompletableFuture<org.bukkit.OfflinePlayer> getOfflinePlayerAsync(String name)
      Creates a new GlowOfflinePlayer instance for the given name.
      Parameters:
      name - the player's name to look up.
      Returns:
      a GlowOfflinePlayer future for the given name.
    • getOfflinePlayerAsync

      public CompletableFuture<org.bukkit.OfflinePlayer> getOfflinePlayerAsync(UUID uuid)
      Creates a new GlowOfflinePlayer instance for the given uuid.
      Parameters:
      uuid - the player's uuid.
      Returns:
      a GlowOfflinePlayer future for the given name.
    • savePlayers

      public void savePlayers()
      Specified by:
      savePlayers in interface org.bukkit.Server
    • broadcast

      public int broadcast(String message, String permission)
      Specified by:
      broadcast in interface org.bukkit.Server
    • broadcast

      public int broadcast(@NotNull @NotNull net.kyori.adventure.text.Component message)
      Specified by:
      broadcast in interface org.bukkit.Server
    • broadcast

      public int broadcast(@NotNull @NotNull net.kyori.adventure.text.Component component, @NotNull @NotNull String s)
      Specified by:
      broadcast in interface org.bukkit.Server
    • broadcast

      public void broadcast(net.md_5.bungee.api.chat.BaseComponent component)
      Specified by:
      broadcast in interface org.bukkit.Server
    • broadcast

      public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components)
      Specified by:
      broadcast in interface org.bukkit.Server
    • broadcastMessage

      public int broadcastMessage(String message)
      Specified by:
      broadcastMessage in interface org.bukkit.Server
    • broadcastPacket

      public void broadcastPacket(com.flowpowered.network.Message message)
      Broadcasts a packet for all online players.
      Parameters:
      message - the packet to broadcast.
    • getWhitelistedPlayers

      public Set<org.bukkit.OfflinePlayer> getWhitelistedPlayers()
      Specified by:
      getWhitelistedPlayers in interface org.bukkit.Server
    • reloadWhitelist

      public void reloadWhitelist()
      Specified by:
      reloadWhitelist in interface org.bukkit.Server
    • getIPBans

      public Set<String> getIPBans()
      Specified by:
      getIPBans in interface org.bukkit.Server
    • banIP

      public void banIP(String address)
      Specified by:
      banIP in interface org.bukkit.Server
    • unbanIP

      public void unbanIP(String address)
      Specified by:
      unbanIP in interface org.bukkit.Server
    • getBannedPlayers

      public Set<org.bukkit.OfflinePlayer> getBannedPlayers()
      Specified by:
      getBannedPlayers in interface org.bukkit.Server
    • sendPlayerAbilities

      public void sendPlayerAbilities(GlowPlayer player)
      Sends a GlowPlayer their abilities regarding flying and walking.
      Parameters:
      player - The player who is being sent their abilities.
    • getWorld

      public GlowWorld getWorld(String name)
      Specified by:
      getWorld in interface org.bukkit.Server
    • getWorld

      public GlowWorld getWorld(UUID uid)
      Specified by:
      getWorld in interface org.bukkit.Server
    • getWorld

      public org.bukkit.World getWorld(@NotNull @NotNull org.bukkit.NamespacedKey namespacedKey)
      Specified by:
      getWorld in interface org.bukkit.Server
    • createWorldBorder

      @NotNull public @NotNull org.bukkit.WorldBorder createWorldBorder()
      Specified by:
      createWorldBorder in interface org.bukkit.Server
    • getMap

      public GlowMapView getMap(int id)
      Specified by:
      getMap in interface org.bukkit.Server
    • createMap

      public GlowMapView createMap(org.bukkit.World world)
      Specified by:
      createMap in interface org.bukkit.Server
    • createExplorerMap

      @NotNull public @NotNull org.bukkit.inventory.ItemStack createExplorerMap(@NotNull @NotNull org.bukkit.World world, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull org.bukkit.StructureType structureType)
      Specified by:
      createExplorerMap in interface org.bukkit.Server
    • createExplorerMap

      @NotNull public @NotNull org.bukkit.inventory.ItemStack createExplorerMap(@NotNull @NotNull org.bukkit.World world, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull org.bukkit.StructureType structureType, int i, boolean b)
      Specified by:
      createExplorerMap in interface org.bukkit.Server
    • getWorlds

      public List<org.bukkit.World> getWorlds()
      Specified by:
      getWorlds in interface org.bukkit.Server
    • createWorld

      public GlowWorld createWorld(org.bukkit.WorldCreator creator)
      Specified by:
      createWorld in interface org.bukkit.Server
    • unloadWorld

      public boolean unloadWorld(String name, boolean save)
      Specified by:
      unloadWorld in interface org.bukkit.Server
    • unloadWorld

      public boolean unloadWorld(org.bukkit.World world, boolean save)
      Specified by:
      unloadWorld in interface org.bukkit.Server
    • getRecipesFor

      public List<org.bukkit.inventory.Recipe> getRecipesFor(org.bukkit.inventory.ItemStack result)
      Specified by:
      getRecipesFor in interface org.bukkit.Server
    • getRecipe

      public org.bukkit.inventory.Recipe getRecipe(@NotNull @NotNull org.bukkit.NamespacedKey key)
      Specified by:
      getRecipe in interface org.bukkit.Server
    • getCraftingRecipe

      @Nullable public @Nullable org.bukkit.inventory.Recipe getCraftingRecipe(@NotNull @NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull @NotNull org.bukkit.World world)
      Specified by:
      getCraftingRecipe in interface org.bukkit.Server
    • craftItem

      @NotNull public @NotNull org.bukkit.inventory.ItemStack craftItem(@NotNull @NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull @NotNull org.bukkit.World world, @NotNull @NotNull org.bukkit.entity.Player player)
      Specified by:
      craftItem in interface org.bukkit.Server
    • recipeIterator

      public Iterator<org.bukkit.inventory.Recipe> recipeIterator()
      Specified by:
      recipeIterator in interface org.bukkit.Server
    • addRecipe

      public boolean addRecipe(org.bukkit.inventory.Recipe recipe)
      Specified by:
      addRecipe in interface org.bukkit.Server
    • clearRecipes

      public void clearRecipes()
      Specified by:
      clearRecipes in interface org.bukkit.Server
    • resetRecipes

      public void resetRecipes()
      Specified by:
      resetRecipes in interface org.bukkit.Server
    • removeRecipe

      public boolean removeRecipe(@NotNull @NotNull org.bukkit.NamespacedKey key)
      Specified by:
      removeRecipe in interface org.bukkit.Server
    • createInventory

      public org.bukkit.inventory.Inventory createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type)
      Specified by:
      createInventory in interface org.bukkit.Server
    • createInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory createInventory(@Nullable @Nullable org.bukkit.inventory.InventoryHolder inventoryHolder, @NotNull @NotNull org.bukkit.event.inventory.InventoryType inventoryType, @NotNull @NotNull net.kyori.adventure.text.Component component)
      Specified by:
      createInventory in interface org.bukkit.Server
    • createInventory

      public org.bukkit.inventory.Inventory createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type, String title)
      Specified by:
      createInventory in interface org.bukkit.Server
    • createInventory

      public org.bukkit.inventory.Inventory createInventory(org.bukkit.inventory.InventoryHolder owner, int size)
      Specified by:
      createInventory in interface org.bukkit.Server
    • createInventory

      @NotNull public @NotNull org.bukkit.inventory.Inventory createInventory(@Nullable @Nullable org.bukkit.inventory.InventoryHolder inventoryHolder, int i, @NotNull @NotNull net.kyori.adventure.text.Component component) throws IllegalArgumentException
      Specified by:
      createInventory in interface org.bukkit.Server
      Throws:
      IllegalArgumentException
    • createInventory

      public org.bukkit.inventory.Inventory createInventory(org.bukkit.inventory.InventoryHolder owner, int size, String title)
      Specified by:
      createInventory in interface org.bukkit.Server
    • createMerchant

      @NotNull public @NotNull org.bukkit.inventory.Merchant createMerchant(@Nullable @Nullable net.kyori.adventure.text.Component component)
      Specified by:
      createMerchant in interface org.bukkit.Server
    • createMerchant

      public org.bukkit.inventory.Merchant createMerchant(String title)
      Specified by:
      createMerchant in interface org.bukkit.Server
    • getServerIcon

      public GlowServerIcon getServerIcon()
      Specified by:
      getServerIcon in interface org.bukkit.Server
    • loadServerIcon

      public org.bukkit.util.CachedServerIcon loadServerIcon(File file) throws Exception
      Specified by:
      loadServerIcon in interface org.bukkit.Server
      Throws:
      Exception
    • loadServerIcon

      public org.bukkit.util.CachedServerIcon loadServerIcon(BufferedImage image) throws Exception
      Specified by:
      loadServerIcon in interface org.bukkit.Server
      Throws:
      Exception
    • sendPluginMessage

      public void sendPluginMessage(org.bukkit.plugin.Plugin source, String channel, byte[] message)
      Specified by:
      sendPluginMessage in interface org.bukkit.plugin.messaging.PluginMessageRecipient
    • getListeningPluginChannels

      public Set<String> getListeningPluginChannels()
      Specified by:
      getListeningPluginChannels in interface org.bukkit.plugin.messaging.PluginMessageRecipient
    • getDefaultGameMode

      public org.bukkit.GameMode getDefaultGameMode()
      Specified by:
      getDefaultGameMode in interface org.bukkit.Server
    • setDefaultGameMode

      public void setDefaultGameMode(org.bukkit.GameMode mode)
      Specified by:
      setDefaultGameMode in interface org.bukkit.Server
    • getSpawnRadius

      public int getSpawnRadius()
      Specified by:
      getSpawnRadius in interface org.bukkit.Server
    • setSpawnRadius

      public void setSpawnRadius(int value)
      Specified by:
      setSpawnRadius in interface org.bukkit.Server
    • getHideOnlinePlayers

      public boolean getHideOnlinePlayers()
      Specified by:
      getHideOnlinePlayers in interface org.bukkit.Server
    • hasWhitelist

      public boolean hasWhitelist()
      Specified by:
      hasWhitelist in interface org.bukkit.Server
    • getWarningState

      public org.bukkit.Warning.WarningState getWarningState()
      Specified by:
      getWarningState in interface org.bukkit.Server
    • getIdleTimeout

      public int getIdleTimeout()
      Specified by:
      getIdleTimeout in interface org.bukkit.Server
    • setIdleTimeout

      public void setIdleTimeout(int timeout)
      Specified by:
      setIdleTimeout in interface org.bukkit.Server
    • createChunkData

      public org.bukkit.generator.ChunkGenerator.ChunkData createChunkData(org.bukkit.World world)
      Specified by:
      createChunkData in interface org.bukkit.Server
    • createVanillaChunkData

      public org.bukkit.generator.ChunkGenerator.ChunkData createVanillaChunkData(org.bukkit.World world, int x, int z)
      Specified by:
      createVanillaChunkData in interface org.bukkit.Server
    • createBossBar

      public org.bukkit.boss.BossBar createBossBar(String title, org.bukkit.boss.BarColor color, org.bukkit.boss.BarStyle style, org.bukkit.boss.BarFlag... flags)
      Specified by:
      createBossBar in interface org.bukkit.Server
    • createBossBar

      @NotNull public @NotNull org.bukkit.boss.KeyedBossBar createBossBar(org.bukkit.NamespacedKey key, @Nullable String title, org.bukkit.boss.BarColor barColor, org.bukkit.boss.BarStyle barStyle, org.bukkit.boss.BarFlag... barFlags)
      Specified by:
      createBossBar in interface org.bukkit.Server
    • getBossBars

      @NotNull public @NotNull Iterator<org.bukkit.boss.KeyedBossBar> getBossBars()
      Specified by:
      getBossBars in interface org.bukkit.Server
    • getBossBar

      @Nullable public @Nullable org.bukkit.boss.KeyedBossBar getBossBar(@NotNull @NotNull org.bukkit.NamespacedKey namespacedKey)
      Specified by:
      getBossBar in interface org.bukkit.Server
    • removeBossBar

      public boolean removeBossBar(@NotNull @NotNull org.bukkit.NamespacedKey namespacedKey)
      Specified by:
      removeBossBar in interface org.bukkit.Server
    • getTPS

      public double[] getTPS()
      Specified by:
      getTPS in interface org.bukkit.Server
    • getPort

      public int getPort()
      Specified by:
      getPort in interface org.bukkit.Server
    • setPort

      public void setPort(int port)
      Sets the port that the Query server will expose.

      This does not change the port the server will run on.

      Parameters:
      port - the port number
    • getIp

      public String getIp()
      Specified by:
      getIp in interface org.bukkit.Server
    • setIp

      public void setIp(String ip)
      Sets the IP address that the Query server will expose.

      This does not change the IP address the server will run on.

      Parameters:
      ip - the IP address
    • getConfig

      public ServerConfig getConfig()
      Gets the server configuration.
      Returns:
      the server configuration.
    • getWorldConfig

      public static WorldConfig getWorldConfig()
      Gets the world configuration for this server.
      Returns:
      the world configuration for this server.
    • getServerName

      public String getServerName()
    • getServerId

      public String getServerId()
    • getUpdateFolder

      public String getUpdateFolder()
      Specified by:
      getUpdateFolder in interface org.bukkit.Server
    • getUpdateFolderFile

      public File getUpdateFolderFile()
      Specified by:
      getUpdateFolderFile in interface org.bukkit.Server
    • getOnlineMode

      public boolean getOnlineMode()
      Specified by:
      getOnlineMode in interface org.bukkit.Server
    • getAllowNether

      public boolean getAllowNether()
      Specified by:
      getAllowNether in interface org.bukkit.Server
    • getResourcePack

      @NotNull public @NotNull String getResourcePack()
      Specified by:
      getResourcePack in interface org.bukkit.Server
    • getAllowEnd

      public boolean getAllowEnd()
      Specified by:
      getAllowEnd in interface org.bukkit.Server
    • getViewDistance

      public int getViewDistance()
      Specified by:
      getViewDistance in interface org.bukkit.Server
    • getSimulationDistance

      public int getSimulationDistance()
      Specified by:
      getSimulationDistance in interface org.bukkit.Server
    • getMotd

      public String getMotd()
      Specified by:
      getMotd in interface org.bukkit.Server
    • motd

      @NotNull public @NotNull net.kyori.adventure.text.Component motd()
      Specified by:
      motd in interface org.bukkit.Server
    • getWorldContainer

      public File getWorldContainer()
      Specified by:
      getWorldContainer in interface org.bukkit.Server
    • getWorldType

      public String getWorldType()
      Specified by:
      getWorldType in interface org.bukkit.Server
    • getGenerateStructures

      public boolean getGenerateStructures()
      Specified by:
      getGenerateStructures in interface org.bukkit.Server
    • getConnectionThrottle

      public long getConnectionThrottle()
      Specified by:
      getConnectionThrottle in interface org.bukkit.Server
    • getMonstersSpawnEnabled

      public boolean getMonstersSpawnEnabled()
      Gets whether monster spawning is enabled.
      Returns:
      true if monster spawning is enabled, false otherwise.
    • getAnimalsSpawnEnabled

      public boolean getAnimalsSpawnEnabled()
      Gets whether animal spawning is enabled.
      Returns:
      true if animal spawning is enabled, false otherwise.
    • getTicksPerAnimalSpawns

      public int getTicksPerAnimalSpawns()
      Specified by:
      getTicksPerAnimalSpawns in interface org.bukkit.Server
    • getTicksPerMonsterSpawns

      public int getTicksPerMonsterSpawns()
      Specified by:
      getTicksPerMonsterSpawns in interface org.bukkit.Server
    • getTicksPerWaterSpawns

      public int getTicksPerWaterSpawns()
      Specified by:
      getTicksPerWaterSpawns in interface org.bukkit.Server
    • getTicksPerWaterAmbientSpawns

      public int getTicksPerWaterAmbientSpawns()
      Specified by:
      getTicksPerWaterAmbientSpawns in interface org.bukkit.Server
    • getTicksPerWaterUndergroundCreatureSpawns

      public int getTicksPerWaterUndergroundCreatureSpawns()
      Specified by:
      getTicksPerWaterUndergroundCreatureSpawns in interface org.bukkit.Server
    • getTicksPerAmbientSpawns

      public int getTicksPerAmbientSpawns()
      Specified by:
      getTicksPerAmbientSpawns in interface org.bukkit.Server
    • getTicksPerSpawns

      public int getTicksPerSpawns(@NotNull @NotNull org.bukkit.entity.SpawnCategory spawnCategory)
      Specified by:
      getTicksPerSpawns in interface org.bukkit.Server
    • getTickTimes

      public long[] getTickTimes()
      Specified by:
      getTickTimes in interface org.bukkit.Server
    • getAverageTickTime

      public double getAverageTickTime()
      Specified by:
      getAverageTickTime in interface org.bukkit.Server
    • getCurrentTick

      public int getCurrentTick()
      Specified by:
      getCurrentTick in interface org.bukkit.Server
    • isStopping

      public boolean isStopping()
      Specified by:
      isStopping in interface org.bukkit.Server
    • getMobGoals

      public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals()
      Specified by:
      getMobGoals in interface org.bukkit.Server
    • getDatapackManager

      @NotNull public @NotNull io.papermc.paper.datapack.DatapackManager getDatapackManager()
      Specified by:
      getDatapackManager in interface org.bukkit.Server
    • getPotionBrewer

      @NotNull public @NotNull org.bukkit.potion.PotionBrewer getPotionBrewer()
      Specified by:
      getPotionBrewer in interface org.bukkit.Server
    • isHardcore

      public boolean isHardcore()
      Specified by:
      isHardcore in interface org.bukkit.Server
    • isPvpEnabled

      public boolean isPvpEnabled()
      Gets whether PVP is enabled on the server.
      Returns:
      true if PVP is enabled on the server, false otherwise.
    • getMonsterSpawnLimit

      public int getMonsterSpawnLimit()
      Specified by:
      getMonsterSpawnLimit in interface org.bukkit.Server
    • getAnimalSpawnLimit

      public int getAnimalSpawnLimit()
      Specified by:
      getAnimalSpawnLimit in interface org.bukkit.Server
    • getWaterAnimalSpawnLimit

      public int getWaterAnimalSpawnLimit()
      Specified by:
      getWaterAnimalSpawnLimit in interface org.bukkit.Server
    • getAmbientSpawnLimit

      public int getAmbientSpawnLimit()
      Specified by:
      getAmbientSpawnLimit in interface org.bukkit.Server
    • getSpawnLimit

      public int getSpawnLimit(@NotNull @NotNull org.bukkit.entity.SpawnCategory spawnCategory)
      Specified by:
      getSpawnLimit in interface org.bukkit.Server
    • getWaterAmbientSpawnLimit

      public int getWaterAmbientSpawnLimit()
      Specified by:
      getWaterAmbientSpawnLimit in interface org.bukkit.Server
    • getWaterUndergroundCreatureSpawnLimit

      public int getWaterUndergroundCreatureSpawnLimit()
      Specified by:
      getWaterUndergroundCreatureSpawnLimit in interface org.bukkit.Server
    • getShutdownMessage

      public String getShutdownMessage()
      Specified by:
      getShutdownMessage in interface org.bukkit.Server
    • shutdownMessage

      @Nullable public net.kyori.adventure.text.Component shutdownMessage()
      Specified by:
      shutdownMessage in interface org.bukkit.Server
    • getAllowFlight

      public boolean getAllowFlight()
      Specified by:
      getAllowFlight in interface org.bukkit.Server
    • getMaxBuildHeight

      public int getMaxBuildHeight()
      Gets the max building height of the server.
      Returns:
      the max building height of the server, in blocks.
    • getMaxWorldSize

      public int getMaxWorldSize()
      Specified by:
      getMaxWorldSize in interface org.bukkit.Server
    • getClassicWater

      public boolean getClassicWater()
      Whether the server uses the classic water flowing algorithm.
      Returns:
      true if the server uses the classic water flowing algorithm, false otherwise.
    • getConsolePrompt

      public String getConsolePrompt()
      Gets the server's console prompt.
      Returns:
      the server's console prompt.
    • getConsoleDateFormat

      public String getConsoleDateFormat()
      Gets the server console's date format.
      Returns:
      the server console's date format.
    • getConsoleLogDateFormat

      public String getConsoleLogDateFormat()
      Gets the server's console logs date format.
      Returns:
      the server's console logs date format.
    • getServerType

      public String getServerType()
      Gets the server type (e.g. VANILLA, BUKKIT, FML). The server type is meant to be read by mods and thus is not localized server-side. It is output to clients by StatusRequestHandler.handle(GlowSession, StatusRequestMessage), but should be ignored by vanilla clients and localized client-side by modded clients aware of it.

      Currently, this value is set to VANILLA.

      Returns:
      the server type.
    • getAllowClientMods

      public boolean getAllowClientMods()
      Gets whether the server allows client mods.

      This rule is not actually enforced, and is simply exposed to clients as a warning.

      Returns:
      true if client mods are allowed, false otherwise.
    • getPlayerSampleCount

      public int getPlayerSampleCount()
      Gets the maximum size of the player sample as shown on the client's server list when pinging the server.
      Returns:
      the maximum size of the player sample as shown on the client's server list.
    • isGenerationDisabled

      public boolean isGenerationDisabled()
      Gets whether world generation is disabled on the server.
      Returns:
      true if world generation is disabled on the server, false otherwise.
    • doesUseGraphicsCompute

      public boolean doesUseGraphicsCompute()
      Gets whether the server is OpenCL-capable and allowed to use graphics compute functionality.
      Returns:
      true if the server is capable and allowed to use graphics compute functionality, false otherwise.
    • shouldPreventProxy

      public boolean shouldPreventProxy()
      Gets whether the server should prevent player proxy connections.
      Returns:
      true if the server should prevent player proxy connections, false otherwise.
    • getStorageProviderFactory

      public WorldStorageProviderFactory getStorageProviderFactory()
      Gets the current storage provider factory, or null if none has been set by a plugin and the server has not started yet. The storage provider factory will be used to initialize storage for each world.
      Returns:
      The current storage provider, or null.
    • setStorageProvider

      public void setStorageProvider(WorldStorageProviderFactory storageProviderFactory)
      If a storage provider factory has not yet been set, and the server has not fully started yet, this allows plugins to set a storage provider factory, which will be used to create a storage provider for each world. Otherwise, this will throw an IllegalStateException.
      Parameters:
      storageProviderFactory - The world storage provider that is attempting to be set.
    • audiences

      public @NonNull Iterable<? extends net.kyori.adventure.audience.Audience> audiences()
      Specified by:
      audiences in interface net.kyori.adventure.audience.ForwardingAudience
    • getBlockDataManager

      public net.glowstone.block.data.BlockDataManager getBlockDataManager()
      What manages the mapping of Material to BlockData and the mapping between State ID and BlockData.
    • getNetworkServer

      public GameServer getNetworkServer()
      The network server used for network communication.
    • getFishingRewardManager

      public FishingRewardManager getFishingRewardManager()
      The FishingRewards of this server.
    • getMaxPlayers

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

      public void setMaxPlayers(int maxPlayers)
      Specified by:
      setMaxPlayers in interface org.bukkit.Server
    • getRegistry

      public CompoundTag getRegistry()