Class ServerMock

java.lang.Object
org.bukkit.Server.Spigot
be.seeseemelk.mockbukkit.ServerMock
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 ServerMock extends org.bukkit.Server.Spigot implements org.bukkit.Server
  • Constructor Details

    • ServerMock

      public ServerMock()
  • Method Details

    • isOnMainThread

      public boolean isOnMainThread()
      Checks if we are on the main thread. The main thread is the thread used to create this instance of the mock server.
      Returns:
      true if we are on the main thread, false if we are running on a different thread.
    • registerEntity

      public void registerEntity(@NotNull @NotNull EntityMock entity)
      Registers an entity so that the server can track it more easily. Should only be used internally.
      Parameters:
      entity - The entity to register
    • getEntities

      @NotNull public @NotNull Set<EntityMock> getEntities()
      Returns a set of entities that exist on the server instance.
      Returns:
      A set of entities that exist on this server instance.
    • addPlayer

      public void addPlayer(PlayerMock player)
      Add a specific player to the set.
      Parameters:
      player - The player to add.
    • addPlayer

      public PlayerMock addPlayer()
      Creates a random player and adds it.
      Returns:
      The player that was added.
    • addPlayer

      public PlayerMock addPlayer(String name)
      Creates a player with a given name and adds it.
      Parameters:
      name - The name to give to the player.
      Returns:
      The added player.
    • setPlayers

      public void setPlayers(int num)
      Set the numbers of mock players that are on this server. Note that it will remove all players that are already on this server.
      Parameters:
      num - The number of players that are on this server.
    • setOfflinePlayers

      public void setOfflinePlayers(int num)
      Set the numbers of mock offline players that are on this server. Note that even players that are online are also considered offline player because an OfflinePlayer really just refers to anyone that has at some point in time played on the server.
      Parameters:
      num - The number of players that are on this server.
    • getPlayer

      public PlayerMock getPlayer(int num)
      Get a specific mock player. A player's number will never change between invocations of setPlayers(int).
      Parameters:
      num - The number of the player to retrieve.
      Returns:
      The chosen player.
    • getPlayerList

      @NotNull public @NotNull MockPlayerList getPlayerList()
      Returns the MockPlayerList instance that is used by this server.
      Returns:
      The MockPlayerList instance.
    • getPlayerUniqueId

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

      public WorldMock addSimpleWorld(String name)
      Adds a very simple super flat world with a given name.
      Parameters:
      name - The name to give to the world.
      Returns:
      The WorldMock that has been created.
    • addWorld

      public void addWorld(WorldMock world)
      Adds the given mocked world to this server.
      Parameters:
      world - The world to add.
    • executeConsole

      public CommandResult executeConsole(org.bukkit.command.Command command, String... args)
      Executes a command as the console.
      Parameters:
      command - The command to execute.
      args - The arguments to pass to the commands.
      Returns:
      The value returned by Command.execute(org.bukkit.command.CommandSender, java.lang.String, java.lang.String[]).
    • executeConsole

      public CommandResult executeConsole(String command, String... args)
      Executes a command as the console.
      Parameters:
      command - The command to execute.
      args - The arguments to pass to the commands.
      Returns:
      The value returned by Command.execute(org.bukkit.command.CommandSender, java.lang.String, java.lang.String[]).
    • executePlayer

      public CommandResult executePlayer(org.bukkit.command.Command command, String... args)
      Executes a command as a player.
      Parameters:
      command - The command to execute.
      args - The arguments to pass to the commands.
      Returns:
      The value returned by Command.execute(org.bukkit.command.CommandSender, java.lang.String, java.lang.String[]).
    • executePlayer

      public CommandResult executePlayer(String command, String... args)
      Executes a command as a player.
      Parameters:
      command - The command to execute.
      args - The arguments to pass to the commands.
      Returns:
      The value returned by Command.execute(org.bukkit.command.CommandSender, java.lang.String, java.lang.String[]).
    • execute

      public CommandResult execute(org.bukkit.command.Command command, org.bukkit.command.CommandSender sender, String... args)
      Executes a command.
      Parameters:
      command - The command to execute.
      sender - The person that executed the command.
      args - The arguments to pass to the commands.
      Returns:
      The value returned by Command.execute(org.bukkit.command.CommandSender, java.lang.String, java.lang.String[]).
    • execute

      public CommandResult execute(String command, org.bukkit.command.CommandSender sender, String... args)
      Executes a command.
      Parameters:
      command - The command to execute.
      sender - The person that executed the command.
      args - The arguments to pass to the commands.
      Returns:
      The value returned by Command.execute(org.bukkit.command.CommandSender, java.lang.String, java.lang.String[]).
    • getName

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

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

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

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

      public Collection<? extends PlayerMock> getOnlinePlayers()
      Specified by:
      getOnlinePlayers in interface org.bukkit.Server
    • getOfflinePlayers

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

      @Nullable public @Nullable org.bukkit.OfflinePlayer getOfflinePlayerIfCached(@NotNull @NotNull String name)
      Specified by:
      getOfflinePlayerIfCached in interface org.bukkit.Server
    • getPlayer

      public org.bukkit.entity.Player getPlayer(String name)
      Specified by:
      getPlayer 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
    • getPlayer

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

      public PluginManagerMock getPluginManager()
      Specified by:
      getPluginManager in interface org.bukkit.Server
    • getCommandMap

      @NotNull public @NotNull MockCommandMap getCommandMap()
      Specified by:
      getCommandMap in interface org.bukkit.Server
    • getPluginCommand

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

      public Logger getLogger()
      Specified by:
      getLogger 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
    • createInventory

      @NotNull @Deprecated public @NotNull InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type, String title, int size)
      Deprecated.
    • createInventory

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

      @NotNull public @NotNull InventoryMock createInventory(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull @NotNull org.bukkit.event.inventory.InventoryType type, @NotNull @NotNull net.kyori.adventure.text.Component title)
      Specified by:
      createInventory in interface org.bukkit.Server
    • createInventory

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

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

      @NotNull public @NotNull InventoryMock createInventory(@Nullable @Nullable org.bukkit.inventory.InventoryHolder owner, int size, @NotNull @NotNull net.kyori.adventure.text.Component title) throws IllegalArgumentException
      Specified by:
      createInventory in interface org.bukkit.Server
      Throws:
      IllegalArgumentException
    • createInventory

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

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

      @NotNull public @NotNull ItemFactoryMock getItemFactory()
      Specified by:
      getItemFactory in interface org.bukkit.Server
    • getWorlds

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

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

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

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

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

      public BukkitSchedulerMock getScheduler()
      Specified by:
      getScheduler in interface org.bukkit.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
    • 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
    • getBanList

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

      public Set<org.bukkit.OfflinePlayer> getOperators()
      Specified by:
      getOperators in interface org.bukkit.Server
    • 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
    • broadcastMessage

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

      @Deprecated public int broadcast(String message, String permission)
      Deprecated.
      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 message, @NotNull @NotNull String permission)
      Specified by:
      broadcast in interface org.bukkit.Server
    • registerSerializables

      public static void registerSerializables()
      Registers any classes that are serializable with the ConfigurationSerializable system of Bukkit.
    • addRecipe

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

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

      public org.bukkit.inventory.Recipe getRecipe(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
    • removeRecipe

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

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

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

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

      public List<String> getCommandTabComplete(org.bukkit.command.CommandSender sender, String commandLine)
    • getHelpMap

      public HelpMapMock getHelpMap()
      Specified by:
      getHelpMap in interface org.bukkit.Server
    • sendPluginMessage

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

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

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

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

      public String getIp()
      Specified by:
      getIp 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
    • getAllowEnd

      public boolean getAllowEnd()
      Specified by:
      getAllowEnd 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
    • getResourcePackHash

      @NotNull public @NotNull String getResourcePackHash()
      Specified by:
      getResourcePackHash in interface org.bukkit.Server
    • 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
    • hasWhitelist

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

      public void setWhitelist(boolean value)
      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
    • 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
    • getUpdateFolder

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

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

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

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

      @Deprecated public int getTicksPerMonsterSpawns()
      Deprecated.
      Specified by:
      getTicksPerMonsterSpawns in interface org.bukkit.Server
    • getServicesManager

      public ServicesManagerMock getServicesManager()
      Specified by:
      getServicesManager in interface org.bukkit.Server
    • createWorld

      public org.bukkit.World 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
    • createMap

      @NotNull public @NotNull MapViewMock createMap(@NotNull @NotNull org.bukkit.World world)
      Specified by:
      createMap in interface org.bukkit.Server
    • reload

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

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

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

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

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

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

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

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

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

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

      public void shutdown()
      Specified by:
      shutdown in interface org.bukkit.Server
    • 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 id)
      Specified by:
      getOfflinePlayer in interface org.bukkit.Server
    • getBannedPlayers

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

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

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

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

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

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

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

      @Deprecated public int getAmbientSpawnLimit()
      Deprecated.
      Specified by:
      getAmbientSpawnLimit in interface org.bukkit.Server
    • isPrimaryThread

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

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

      @Deprecated @NotNull public @NotNull String getMotd()
      Deprecated.
      Specified by:
      getMotd in interface org.bukkit.Server
    • shutdownMessage

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

      @Deprecated public String getShutdownMessage()
      Deprecated.
      Specified by:
      getShutdownMessage in interface org.bukkit.Server
    • setWarningState

      public void setWarningState(@NotNull @NotNull org.bukkit.Warning.WarningState warningState)
      Sets the return value of getWarningState().
      Parameters:
      warningState - The Warning.WarningState to set.
    • getWarningState

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

      public ScoreboardManagerMock getScoreboardManager()
      Specified by:
      getScoreboardManager in interface org.bukkit.Server
    • getServerIcon

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

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

      public org.bukkit.util.CachedServerIcon loadServerIcon(BufferedImage image)
      Specified by:
      loadServerIcon in interface org.bukkit.Server
    • setIdleTimeout

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

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

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

      @Deprecated(forRemoval=true) @NotNull public @NotNull org.bukkit.generator.ChunkGenerator.ChunkData createVanillaChunkData(@NotNull @NotNull org.bukkit.World world, int x, int z)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
    • getEntity

      @Nullable public @Nullable org.bukkit.entity.Entity getEntity(@NotNull @NotNull UUID uuid)
      Specified by:
      getEntity in interface org.bukkit.Server
    • getTPS

      @NotNull public @org.jetbrains.annotations.NotNull double[] getTPS()
      Specified by:
      getTPS in interface org.bukkit.Server
    • getTickTimes

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

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

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

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

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

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

      @NotNull public @NotNull org.bukkit.block.data.BlockData createBlockData(@NotNull @NotNull org.bukkit.Material material, @Nullable @Nullable 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)
      Specified by:
      createBlockData in interface org.bukkit.Server
    • createBlockData

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

      @NotNull public @NotNull org.bukkit.Tag<org.bukkit.Material> createMaterialTag(@NotNull @NotNull org.bukkit.NamespacedKey key, @NotNull @NotNull String registryKey, @NotNull @NotNull org.bukkit.Material... materials)
      This creates a new Mock Tag for the Material class.
      Call this in advance before you are gonna access getTag(String, NamespacedKey, Class) or any of the constants defined in Tag.
      Parameters:
      key - The NamespacedKey for this Tag
      registryKey - The name of the TagRegistry.
      materials - Materials which should be covered by this Tag
      Returns:
      The newly created Tag
    • addTagRegistry

      public void addTagRegistry(@NotNull @NotNull TagRegistry registry)
    • getTag

      public <T extends org.bukkit.Keyed> org.bukkit.Tag<T> getTag(String registryKey, org.bukkit.NamespacedKey key, Class<T> clazz)
      Specified by:
      getTag in interface org.bukkit.Server
    • getLootTable

      public org.bukkit.loot.LootTable getLootTable(org.bukkit.NamespacedKey key)
      Specified by:
      getLootTable in interface org.bukkit.Server
    • createExplorerMap

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

      public org.bukkit.inventory.ItemStack createExplorerMap(org.bukkit.World world, org.bukkit.Location location, org.bukkit.StructureType structureType, int radius, boolean findUnexplored)
      Specified by:
      createExplorerMap in interface org.bukkit.Server
    • createBossBar

      public org.bukkit.boss.KeyedBossBar createBossBar(org.bukkit.NamespacedKey key, 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
    • getBossBars

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

      public org.bukkit.boss.KeyedBossBar getBossBar(org.bukkit.NamespacedKey key)
      Specified by:
      getBossBar in interface org.bukkit.Server
    • removeBossBar

      public boolean removeBossBar(org.bukkit.NamespacedKey key)
      Specified by:
      removeBossBar in interface org.bukkit.Server
    • selectEntities

      public List<org.bukkit.entity.Entity> selectEntities(org.bukkit.command.CommandSender sender, String selector)
      Specified by:
      selectEntities in interface org.bukkit.Server
    • getStructureManager

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

      @Deprecated public MapViewMock getMap(int id)
      Deprecated.
      Specified by:
      getMap in interface org.bukkit.Server
    • getTags

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

      @Deprecated public int getTicksPerWaterSpawns()
      Deprecated.
      Specified by:
      getTicksPerWaterSpawns in interface org.bukkit.Server
    • getTicksPerAmbientSpawns

      @Deprecated public int getTicksPerAmbientSpawns()
      Deprecated.
      Specified by:
      getTicksPerAmbientSpawns in interface org.bukkit.Server
    • getCurrentServerTime

      protected long getCurrentServerTime()
      This returns the current time of the Server in milliseconds
      Returns:
      The current Server time
    • getTicksPerWaterAmbientSpawns

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

      @Deprecated public int getTicksPerWaterUndergroundCreatureSpawns()
      Deprecated.
      Specified by:
      getTicksPerWaterUndergroundCreatureSpawns in interface org.bukkit.Server
    • getWaterAmbientSpawnLimit

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

      @Deprecated public int getWaterUndergroundCreatureSpawnLimit()
      Deprecated.
      Specified by:
      getWaterUndergroundCreatureSpawnLimit in interface org.bukkit.Server
    • getMaxWorldSize

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

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

      public boolean getHideOnlinePlayers()
      Specified by:
      getHideOnlinePlayers 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
    • 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

      @NotNull public @NotNull PlayerProfileMock createProfile(@NotNull @NotNull UUID uuid)
      Specified by:
      createProfile in interface org.bukkit.Server
    • createProfile

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

      @NotNull public @NotNull PlayerProfileMock createProfile(@Nullable @Nullable UUID uuid, @Nullable @Nullable String name)
      Specified by:
      createProfile in interface org.bukkit.Server
    • createProfileExact

      @NotNull public @NotNull PlayerProfileMock createProfileExact(@Nullable @Nullable UUID uuid, @Nullable @Nullable String name)
      Specified by:
      createProfileExact 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

      @NotNull public @NotNull 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
    • getConfig

      @NotNull public @NotNull org.bukkit.configuration.file.YamlConfiguration getConfig()
      Overrides:
      getConfig in class org.bukkit.Server.Spigot
    • broadcast

      @Deprecated public void broadcast(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent component)
      Deprecated.
      Specified by:
      broadcast in interface org.bukkit.Server
      Overrides:
      broadcast in class org.bukkit.Server.Spigot
    • broadcast

      @Deprecated public void broadcast(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent... components)
      Deprecated.
      Specified by:
      broadcast in interface org.bukkit.Server
      Overrides:
      broadcast in class org.bukkit.Server.Spigot
    • restart

      public void restart()
      Overrides:
      restart in class org.bukkit.Server.Spigot
    • getTicksPerSpawns

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

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

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

      @Deprecated @NotNull public @NotNull PlayerProfileMock createPlayerProfile(@NotNull @NotNull String name)
      Deprecated.
      Specified by:
      createPlayerProfile in interface org.bukkit.Server
    • getSpawnLimit

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

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

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

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