Package be.seeseemelk.mockbukkit
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.kyori.adventure.audience.ForwardingAudience
net.kyori.adventure.audience.ForwardingAudience.SingleNested classes/interfaces inherited from interface org.bukkit.Server
org.bukkit.Server.Spigot -
Field Summary
Fields inherited from interface org.bukkit.Server
BROADCAST_CHANNEL_ADMINISTRATIVE, BROADCAST_CHANNEL_USERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a random player and adds it.voidaddPlayer(PlayerMock player) Add a specific player to the set.Creates a player with a given name and adds it.booleanaddRecipe(org.bukkit.inventory.Recipe recipe) addSimpleWorld(String name) Adds a very simple super flat world with a given name.voidaddTagRegistry(@NotNull TagRegistry registry) voidAdds the given mocked world to this server.Iterator<org.bukkit.advancement.Advancement>@NotNull Iterable<? extends net.kyori.adventure.audience.Audience>voidintbroadcast(@NotNull net.kyori.adventure.text.Component message) intvoidbroadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) Deprecated.voidbroadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) Deprecated.intDeprecated.intbroadcastMessage(String message) Deprecated.void@NotNull org.bukkit.inventory.ItemStackcraftItem(@NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull org.bukkit.World world, @NotNull org.bukkit.entity.Player player) @NotNull org.bukkit.block.data.BlockDatacreateBlockData(@NotNull org.bukkit.Material material) @NotNull org.bukkit.block.data.BlockDatacreateBlockData(@NotNull org.bukkit.Material material, @Nullable Consumer<org.bukkit.block.data.BlockData> consumer) org.bukkit.block.data.BlockDatacreateBlockData(String data) org.bukkit.block.data.BlockDatacreateBlockData(org.bukkit.Material material, String data) org.bukkit.boss.BossBarcreateBossBar(String title, org.bukkit.boss.BarColor color, org.bukkit.boss.BarStyle style, org.bukkit.boss.BarFlag... flags) org.bukkit.boss.KeyedBossBarcreateBossBar(org.bukkit.NamespacedKey key, String title, org.bukkit.boss.BarColor color, org.bukkit.boss.BarStyle style, org.bukkit.boss.BarFlag... flags) @NotNull org.bukkit.generator.ChunkGenerator.ChunkDatacreateChunkData(@NotNull org.bukkit.World world) @NotNull org.bukkit.command.CommandSendercreateCommandSender(@NotNull Consumer<? super net.kyori.adventure.text.Component> feedback) org.bukkit.inventory.ItemStackcreateExplorerMap(org.bukkit.World world, org.bukkit.Location location, org.bukkit.StructureType structureType) org.bukkit.inventory.ItemStackcreateExplorerMap(org.bukkit.World world, org.bukkit.Location location, org.bukkit.StructureType structureType, int radius, boolean findUnexplored) @NotNull InventoryMockcreateInventory(@Nullable org.bukkit.inventory.InventoryHolder owner, int size, @NotNull net.kyori.adventure.text.Component title) @NotNull InventoryMockcreateInventory(@Nullable org.bukkit.inventory.InventoryHolder owner, @NotNull org.bukkit.event.inventory.InventoryType type, @NotNull net.kyori.adventure.text.Component title) createInventory(org.bukkit.inventory.InventoryHolder owner, int size) createInventory(org.bukkit.inventory.InventoryHolder owner, int size, String title) Deprecated.createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type) createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type, String title) Deprecated.@NotNull InventoryMockcreateInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type, String title, int size) Deprecated.@NotNull MapViewMockcreateMap(@NotNull org.bukkit.World world) @NotNull org.bukkit.Tag<org.bukkit.Material>createMaterialTag(@NotNull org.bukkit.NamespacedKey key, @NotNull String registryKey, @NotNull org.bukkit.Material... materials) This creates a new MockTagfor theMaterialclass.
Call this in advance before you are gonna accessgetTag(String, NamespacedKey, Class)or any of the constants defined inTag.org.bukkit.inventory.MerchantcreateMerchant(@Nullable net.kyori.adventure.text.Component title) org.bukkit.inventory.MerchantcreateMerchant(String title) Deprecated.@NotNull PlayerProfileMockcreatePlayerProfile(@NotNull String name) Deprecated.@NotNull PlayerProfileMockcreatePlayerProfile(@NotNull UUID uniqueId) Deprecated.@NotNull PlayerProfileMockcreatePlayerProfile(@Nullable UUID uniqueId, @Nullable String name) Deprecated.@NotNull PlayerProfileMockcreateProfile(@NotNull String name) @NotNull PlayerProfileMockcreateProfile(@NotNull UUID uuid) @NotNull PlayerProfileMockcreateProfile(@Nullable UUID uuid, @Nullable String name) @NotNull PlayerProfileMockcreateProfileExact(@Nullable UUID uuid, @Nullable String name) @NotNull org.bukkit.generator.ChunkGenerator.ChunkDatacreateVanillaChunkData(@NotNull org.bukkit.World world, int x, int z) Deprecated, for removal: This API element is subject to removal in a future version.org.bukkit.WorldcreateWorld(org.bukkit.WorldCreator creator) @NotNull org.bukkit.WorldBorderbooleandispatchCommand(org.bukkit.command.CommandSender sender, String commandLine) Executes a command.execute(org.bukkit.command.Command command, org.bukkit.command.CommandSender sender, String... args) Executes a command.executeConsole(String command, String... args) Executes a command as the console.executeConsole(org.bukkit.command.Command command, String... args) Executes a command as the console.executePlayer(String command, String... args) Executes a command as a player.executePlayer(org.bukkit.command.Command command, String... args) Executes a command as a player.org.bukkit.advancement.AdvancementgetAdvancement(org.bukkit.NamespacedKey key) booleanbooleanbooleanintDeprecated.intDeprecated.double@NotNull org.bukkit.BanListgetBanList(@NotNull org.bukkit.BanList.Type type) Set<org.bukkit.OfflinePlayer>org.bukkit.boss.KeyedBossBargetBossBar(org.bukkit.NamespacedKey key) Iterator<org.bukkit.boss.KeyedBossBar>@NotNull String@NotNull MockCommandMapgetCommandTabComplete(org.bukkit.command.CommandSender sender, String commandLine) @NotNull org.bukkit.configuration.file.YamlConfigurationlongorg.bukkit.command.ConsoleCommandSender@Nullable org.bukkit.inventory.RecipegetCraftingRecipe(@NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull org.bukkit.World world) protected longThis returns the current time of theServerin millisecondsint@NotNull io.papermc.paper.datapack.DatapackManagerorg.bukkit.GameMode@NotNull Set<EntityMock>Returns a set of entities that exist on the server instance.@Nullable org.bukkit.entity.EntitybooleanbooleanintgetIp()@NotNull ItemFactoryMockorg.bukkit.loot.LootTablegetLootTable(org.bukkit.NamespacedKey key) getMap(int id) Deprecated.intint@NotNull org.bukkit.plugin.messaging.Messenger@NotNull String@NotNull com.destroystokyo.paper.entity.ai.MobGoalsintDeprecated.@NotNull StringgetMotd()Deprecated.getName()org.bukkit.OfflinePlayergetOfflinePlayer(String name) Deprecated.org.bukkit.OfflinePlayergetOfflinePlayer(UUID id) @Nullable org.bukkit.OfflinePlayergetOfflinePlayerIfCached(@NotNull String name) org.bukkit.OfflinePlayer[]booleanCollection<? extends PlayerMock>Set<org.bukkit.OfflinePlayer>@NotNull StringgetPlayer(int num) Get a specific mock player.org.bukkit.entity.Playerorg.bukkit.entity.Playerorg.bukkit.entity.PlayergetPlayerExact(String name) @NotNull MockPlayerListReturns theMockPlayerListinstance that is used by this server.@Nullable UUIDgetPlayerUniqueId(@NotNull String playerName) org.bukkit.command.PluginCommandgetPluginCommand(String name) @NotNull FileintgetPort()@NotNull org.bukkit.potion.PotionBrewerorg.bukkit.inventory.RecipegetRecipe(org.bukkit.NamespacedKey key) List<org.bukkit.inventory.Recipe>getRecipesFor(@NotNull org.bukkit.inventory.ItemStack item) @NotNull String@NotNull String@NotNull Stringorg.bukkit.util.CachedServerIconDeprecated.intintgetSpawnLimit(@NotNull org.bukkit.entity.SpawnCategory spawnCategory) int@NotNull org.bukkit.structure.StructureManager<T extends org.bukkit.Keyed>
org.bukkit.Tag<T><T extends org.bukkit.Keyed>
Iterable<org.bukkit.Tag<T>>intDeprecated.intDeprecated.intDeprecated.intgetTicksPerSpawns(@NotNull org.bukkit.entity.SpawnCategory spawnCategory) intintDeprecated.intDeprecated.@org.jetbrains.annotations.NotNull long[]@org.jetbrains.annotations.NotNull double[]getTPS()Deprecated.@NotNull Stringint@NotNull org.bukkit.Warning.WarningStateintDeprecated.intDeprecated.intDeprecated.Set<org.bukkit.OfflinePlayer>@Nullable org.bukkit.WorldgetWorld(@NotNull org.bukkit.NamespacedKey worldKey) org.bukkit.Worldorg.bukkit.WorldList<org.bukkit.World>booleanbooleanbooleanChecks if we are on the main thread.booleanbooleanbooleanbooleanorg.bukkit.util.CachedServerIconloadServerIcon(BufferedImage image) org.bukkit.util.CachedServerIconloadServerIcon(File file) List<org.bukkit.entity.Player>matchPlayer(String name) @NotNull net.kyori.adventure.text.Componentmotd()@NotNull net.kyori.adventure.text.ComponentIterator<org.bukkit.inventory.Recipe>voidregisterEntity(@NotNull EntityMock entity) Registers an entity so that the server can track it more easily.static voidRegisters any classes that are serializable with the ConfigurationSerializable system of Bukkit.voidreload()booleanvoidvoidvoidbooleanremoveBossBar(org.bukkit.NamespacedKey key) booleanremoveRecipe(org.bukkit.NamespacedKey key) voidvoidrestart()voidList<org.bukkit.entity.Entity>selectEntities(org.bukkit.command.CommandSender sender, String selector) voidsendPluginMessage(@NotNull org.bukkit.plugin.Plugin source, @NotNull String channel, byte[] message) voidsetDefaultGameMode(org.bukkit.GameMode mode) voidsetIdleTimeout(int threshold) voidsetMaxPlayers(int maxPlayers) voidsetOfflinePlayers(int num) Set the numbers of mock offline players that are on this server.voidsetPlayers(int num) Set the numbers of mock players that are on this server.voidsetSpawnRadius(int spawnRadius) voidsetWarningState(@NotNull org.bukkit.Warning.WarningState warningState) Sets the return value ofgetWarningState().voidsetWhitelist(boolean value) voidsetWhitelistEnforced(boolean value) voidshutdown()@Nullable net.kyori.adventure.text.Componentorg.bukkit.Server.Spigotspigot()booleanvoidbooleanunloadWorld(String name, boolean save) booleanunloadWorld(org.bukkit.World world, boolean save) Methods inherited from class org.bukkit.Server.Spigot
getBukkitConfig, getPaperConfig, getSpigotConfigMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.kyori.adventure.audience.Audience
openBook, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, showTitle, stopSoundMethods inherited from interface net.kyori.adventure.audience.ForwardingAudience
clearTitle, filterAudience, forEachAudience, hideBossBar, openBook, playSound, playSound, playSound, pointers, resetTitle, sendActionBar, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, stopSoundMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom
-
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:
trueif we are on the main thread,falseif we are running on a different thread.
-
registerEntity
Registers an entity so that the server can track it more easily. Should only be used internally.- Parameters:
entity- The entity to register
-
getEntities
Returns a set of entities that exist on the server instance.- Returns:
- A set of entities that exist on this server instance.
-
addPlayer
Add a specific player to the set.- Parameters:
player- The player to add.
-
addPlayer
Creates a random player and adds it.- Returns:
- The player that was added.
-
addPlayer
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 anOfflinePlayerreally 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
Get a specific mock player. A player's number will never change between invocations ofsetPlayers(int).- Parameters:
num- The number of the player to retrieve.- Returns:
- The chosen player.
-
getPlayerList
Returns theMockPlayerListinstance that is used by this server.- Returns:
- The
MockPlayerListinstance.
-
getPlayerUniqueId
- Specified by:
getPlayerUniqueIdin interfaceorg.bukkit.Server
-
addSimpleWorld
Adds a very simple super flat world with a given name.- Parameters:
name- The name to give to the world.- Returns:
- The
WorldMockthat has been created.
-
addWorld
Adds the given mocked world to this server.- Parameters:
world- The world to add.
-
executeConsole
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
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
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
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
- Specified by:
getNamein interfaceorg.bukkit.Server
-
getVersion
- Specified by:
getVersionin interfaceorg.bukkit.Server
-
getBukkitVersion
- Specified by:
getBukkitVersionin interfaceorg.bukkit.Server
-
getMinecraftVersion
- Specified by:
getMinecraftVersionin interfaceorg.bukkit.Server
-
getOnlinePlayers
- Specified by:
getOnlinePlayersin interfaceorg.bukkit.Server
-
getOfflinePlayers
public org.bukkit.OfflinePlayer[] getOfflinePlayers()- Specified by:
getOfflinePlayersin interfaceorg.bukkit.Server
-
getOfflinePlayerIfCached
@Nullable public @Nullable org.bukkit.OfflinePlayer getOfflinePlayerIfCached(@NotNull @NotNull String name) - Specified by:
getOfflinePlayerIfCachedin interfaceorg.bukkit.Server
-
getPlayer
- Specified by:
getPlayerin interfaceorg.bukkit.Server
-
getPlayerExact
- Specified by:
getPlayerExactin interfaceorg.bukkit.Server
-
matchPlayer
- Specified by:
matchPlayerin interfaceorg.bukkit.Server
-
getPlayer
- Specified by:
getPlayerin interfaceorg.bukkit.Server
-
getPluginManager
- Specified by:
getPluginManagerin interfaceorg.bukkit.Server
-
getCommandMap
- Specified by:
getCommandMapin interfaceorg.bukkit.Server
-
getPluginCommand
- Specified by:
getPluginCommandin interfaceorg.bukkit.Server
-
getLogger
- Specified by:
getLoggerin interfaceorg.bukkit.Server
-
getConsoleSender
public org.bukkit.command.ConsoleCommandSender getConsoleSender()- Specified by:
getConsoleSenderin interfaceorg.bukkit.Server
-
createCommandSender
@NotNull public @NotNull org.bukkit.command.CommandSender createCommandSender(@NotNull @NotNull Consumer<? super net.kyori.adventure.text.Component> feedback) - Specified by:
createCommandSenderin interfaceorg.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:
createInventoryin interfaceorg.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:
createInventoryin interfaceorg.bukkit.Server
-
createInventory
@Deprecated public InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type, String title) Deprecated.- Specified by:
createInventoryin interfaceorg.bukkit.Server
-
createInventory
- Specified by:
createInventoryin interfaceorg.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:
createInventoryin interfaceorg.bukkit.Server- Throws:
IllegalArgumentException
-
createInventory
@Deprecated public InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, int size, String title) Deprecated.- Specified by:
createInventoryin interfaceorg.bukkit.Server
-
createMerchant
public org.bukkit.inventory.Merchant createMerchant(@Nullable @Nullable net.kyori.adventure.text.Component title) - Specified by:
createMerchantin interfaceorg.bukkit.Server
-
getItemFactory
- Specified by:
getItemFactoryin interfaceorg.bukkit.Server
-
getWorlds
- Specified by:
getWorldsin interfaceorg.bukkit.Server
-
getWorld
- Specified by:
getWorldin interfaceorg.bukkit.Server
-
getWorld
- Specified by:
getWorldin interfaceorg.bukkit.Server
-
getWorld
@Nullable public @Nullable org.bukkit.World getWorld(@NotNull @NotNull org.bukkit.NamespacedKey worldKey) - Specified by:
getWorldin interfaceorg.bukkit.Server
-
createWorldBorder
@NotNull public @NotNull org.bukkit.WorldBorder createWorldBorder()- Specified by:
createWorldBorderin interfaceorg.bukkit.Server
-
getScheduler
- Specified by:
getSchedulerin interfaceorg.bukkit.Server
-
getMaxPlayers
public int getMaxPlayers()- Specified by:
getMaxPlayersin interfaceorg.bukkit.Server
-
setMaxPlayers
public void setMaxPlayers(int maxPlayers) - Specified by:
setMaxPlayersin interfaceorg.bukkit.Server
-
getIPBans
- Specified by:
getIPBansin interfaceorg.bukkit.Server
-
banIP
- Specified by:
banIPin interfaceorg.bukkit.Server
-
unbanIP
- Specified by:
unbanIPin interfaceorg.bukkit.Server
-
getBanList
@NotNull public @NotNull org.bukkit.BanList getBanList(@NotNull @NotNull org.bukkit.BanList.Type type) - Specified by:
getBanListin interfaceorg.bukkit.Server
-
getOperators
- Specified by:
getOperatorsin interfaceorg.bukkit.Server
-
getDefaultGameMode
public org.bukkit.GameMode getDefaultGameMode()- Specified by:
getDefaultGameModein interfaceorg.bukkit.Server
-
setDefaultGameMode
public void setDefaultGameMode(org.bukkit.GameMode mode) - Specified by:
setDefaultGameModein interfaceorg.bukkit.Server
-
broadcastMessage
Deprecated.- Specified by:
broadcastMessagein interfaceorg.bukkit.Server
-
broadcast
Deprecated.- Specified by:
broadcastin interfaceorg.bukkit.Server
-
broadcast
public int broadcast(@NotNull @NotNull net.kyori.adventure.text.Component message) - Specified by:
broadcastin interfaceorg.bukkit.Server
-
broadcast
public int broadcast(@NotNull @NotNull net.kyori.adventure.text.Component message, @NotNull @NotNull String permission) - Specified by:
broadcastin interfaceorg.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:
addRecipein interfaceorg.bukkit.Server
-
getRecipesFor
public List<org.bukkit.inventory.Recipe> getRecipesFor(@NotNull @NotNull org.bukkit.inventory.ItemStack item) - Specified by:
getRecipesForin interfaceorg.bukkit.Server
-
getRecipe
public org.bukkit.inventory.Recipe getRecipe(org.bukkit.NamespacedKey key) - Specified by:
getRecipein interfaceorg.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:
getCraftingRecipein interfaceorg.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:
craftItemin interfaceorg.bukkit.Server
-
removeRecipe
public boolean removeRecipe(org.bukkit.NamespacedKey key) - Specified by:
removeRecipein interfaceorg.bukkit.Server
-
recipeIterator
- Specified by:
recipeIteratorin interfaceorg.bukkit.Server
-
clearRecipes
public void clearRecipes()- Specified by:
clearRecipesin interfaceorg.bukkit.Server
-
dispatchCommand
- Specified by:
dispatchCommandin interfaceorg.bukkit.Server
-
getCommandTabComplete
-
getHelpMap
- Specified by:
getHelpMapin interfaceorg.bukkit.Server
-
sendPluginMessage
public void sendPluginMessage(@NotNull @NotNull org.bukkit.plugin.Plugin source, @NotNull @NotNull String channel, byte[] message) - Specified by:
sendPluginMessagein interfaceorg.bukkit.plugin.messaging.PluginMessageRecipient
-
getListeningPluginChannels
- Specified by:
getListeningPluginChannelsin interfaceorg.bukkit.plugin.messaging.PluginMessageRecipient
-
getPort
public int getPort()- Specified by:
getPortin interfaceorg.bukkit.Server
-
getViewDistance
public int getViewDistance()- Specified by:
getViewDistancein interfaceorg.bukkit.Server
-
getIp
- Specified by:
getIpin interfaceorg.bukkit.Server
-
getWorldType
- Specified by:
getWorldTypein interfaceorg.bukkit.Server
-
getGenerateStructures
public boolean getGenerateStructures()- Specified by:
getGenerateStructuresin interfaceorg.bukkit.Server
-
getAllowEnd
public boolean getAllowEnd()- Specified by:
getAllowEndin interfaceorg.bukkit.Server
-
getAllowNether
public boolean getAllowNether()- Specified by:
getAllowNetherin interfaceorg.bukkit.Server
-
getResourcePack
- Specified by:
getResourcePackin interfaceorg.bukkit.Server
-
getResourcePackHash
- Specified by:
getResourcePackHashin interfaceorg.bukkit.Server
-
getResourcePackPrompt
- Specified by:
getResourcePackPromptin interfaceorg.bukkit.Server
-
isResourcePackRequired
public boolean isResourcePackRequired()- Specified by:
isResourcePackRequiredin interfaceorg.bukkit.Server
-
hasWhitelist
public boolean hasWhitelist()- Specified by:
hasWhitelistin interfaceorg.bukkit.Server
-
setWhitelist
public void setWhitelist(boolean value) - Specified by:
setWhitelistin interfaceorg.bukkit.Server
-
isWhitelistEnforced
public boolean isWhitelistEnforced()- Specified by:
isWhitelistEnforcedin interfaceorg.bukkit.Server
-
setWhitelistEnforced
public void setWhitelistEnforced(boolean value) - Specified by:
setWhitelistEnforcedin interfaceorg.bukkit.Server
-
getWhitelistedPlayers
- Specified by:
getWhitelistedPlayersin interfaceorg.bukkit.Server
-
reloadWhitelist
public void reloadWhitelist()- Specified by:
reloadWhitelistin interfaceorg.bukkit.Server
-
getUpdateFolder
- Specified by:
getUpdateFolderin interfaceorg.bukkit.Server
-
getUpdateFolderFile
- Specified by:
getUpdateFolderFilein interfaceorg.bukkit.Server
-
getConnectionThrottle
public long getConnectionThrottle()- Specified by:
getConnectionThrottlein interfaceorg.bukkit.Server
-
getTicksPerAnimalSpawns
Deprecated.- Specified by:
getTicksPerAnimalSpawnsin interfaceorg.bukkit.Server
-
getTicksPerMonsterSpawns
Deprecated.- Specified by:
getTicksPerMonsterSpawnsin interfaceorg.bukkit.Server
-
getServicesManager
- Specified by:
getServicesManagerin interfaceorg.bukkit.Server
-
createWorld
public org.bukkit.World createWorld(org.bukkit.WorldCreator creator) - Specified by:
createWorldin interfaceorg.bukkit.Server
-
unloadWorld
- Specified by:
unloadWorldin interfaceorg.bukkit.Server
-
unloadWorld
public boolean unloadWorld(org.bukkit.World world, boolean save) - Specified by:
unloadWorldin interfaceorg.bukkit.Server
-
createMap
- Specified by:
createMapin interfaceorg.bukkit.Server
-
reload
public void reload()- Specified by:
reloadin interfaceorg.bukkit.Server
-
reloadData
public void reloadData()- Specified by:
reloadDatain interfaceorg.bukkit.Server
-
savePlayers
public void savePlayers()- Specified by:
savePlayersin interfaceorg.bukkit.Server
-
resetRecipes
public void resetRecipes()- Specified by:
resetRecipesin interfaceorg.bukkit.Server
-
getCommandAliases
- Specified by:
getCommandAliasesin interfaceorg.bukkit.Server
-
getSpawnRadius
public int getSpawnRadius()- Specified by:
getSpawnRadiusin interfaceorg.bukkit.Server
-
setSpawnRadius
public void setSpawnRadius(int spawnRadius) - Specified by:
setSpawnRadiusin interfaceorg.bukkit.Server
-
getOnlineMode
public boolean getOnlineMode()- Specified by:
getOnlineModein interfaceorg.bukkit.Server
-
getAllowFlight
public boolean getAllowFlight()- Specified by:
getAllowFlightin interfaceorg.bukkit.Server
-
isHardcore
public boolean isHardcore()- Specified by:
isHardcorein interfaceorg.bukkit.Server
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceorg.bukkit.Server
-
getOfflinePlayer
Deprecated.- Specified by:
getOfflinePlayerin interfaceorg.bukkit.Server
-
getOfflinePlayer
- Specified by:
getOfflinePlayerin interfaceorg.bukkit.Server
-
getBannedPlayers
- Specified by:
getBannedPlayersin interfaceorg.bukkit.Server
-
getWorldContainer
- Specified by:
getWorldContainerin interfaceorg.bukkit.Server
-
getMessenger
@NotNull public @NotNull org.bukkit.plugin.messaging.Messenger getMessenger()- Specified by:
getMessengerin interfaceorg.bukkit.Server
-
createMerchant
Deprecated.- Specified by:
createMerchantin interfaceorg.bukkit.Server
-
getMonsterSpawnLimit
Deprecated.- Specified by:
getMonsterSpawnLimitin interfaceorg.bukkit.Server
-
getAnimalSpawnLimit
Deprecated.- Specified by:
getAnimalSpawnLimitin interfaceorg.bukkit.Server
-
getWaterAnimalSpawnLimit
Deprecated.- Specified by:
getWaterAnimalSpawnLimitin interfaceorg.bukkit.Server
-
getAmbientSpawnLimit
Deprecated.- Specified by:
getAmbientSpawnLimitin interfaceorg.bukkit.Server
-
isPrimaryThread
public boolean isPrimaryThread()- Specified by:
isPrimaryThreadin interfaceorg.bukkit.Server
-
motd
@NotNull public @NotNull net.kyori.adventure.text.Component motd()- Specified by:
motdin interfaceorg.bukkit.Server
-
getMotd
Deprecated.- Specified by:
getMotdin interfaceorg.bukkit.Server
-
shutdownMessage
@Nullable public @Nullable net.kyori.adventure.text.Component shutdownMessage()- Specified by:
shutdownMessagein interfaceorg.bukkit.Server
-
getShutdownMessage
Deprecated.- Specified by:
getShutdownMessagein interfaceorg.bukkit.Server
-
setWarningState
public void setWarningState(@NotNull @NotNull org.bukkit.Warning.WarningState warningState) Sets the return value ofgetWarningState().- Parameters:
warningState- TheWarning.WarningStateto set.
-
getWarningState
@NotNull public @NotNull org.bukkit.Warning.WarningState getWarningState()- Specified by:
getWarningStatein interfaceorg.bukkit.Server
-
getScoreboardManager
- Specified by:
getScoreboardManagerin interfaceorg.bukkit.Server
-
getServerIcon
public org.bukkit.util.CachedServerIcon getServerIcon()- Specified by:
getServerIconin interfaceorg.bukkit.Server
-
loadServerIcon
- Specified by:
loadServerIconin interfaceorg.bukkit.Server
-
loadServerIcon
- Specified by:
loadServerIconin interfaceorg.bukkit.Server
-
setIdleTimeout
public void setIdleTimeout(int threshold) - Specified by:
setIdleTimeoutin interfaceorg.bukkit.Server
-
getIdleTimeout
public int getIdleTimeout()- Specified by:
getIdleTimeoutin interfaceorg.bukkit.Server
-
createChunkData
@NotNull public @NotNull org.bukkit.generator.ChunkGenerator.ChunkData createChunkData(@NotNull @NotNull org.bukkit.World world) - Specified by:
createChunkDatain interfaceorg.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:
createVanillaChunkDatain interfaceorg.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:
createBossBarin interfaceorg.bukkit.Server
-
getEntity
- Specified by:
getEntityin interfaceorg.bukkit.Server
-
getTPS
@NotNull public @org.jetbrains.annotations.NotNull double[] getTPS()- Specified by:
getTPSin interfaceorg.bukkit.Server
-
getTickTimes
@NotNull public @org.jetbrains.annotations.NotNull long[] getTickTimes()- Specified by:
getTickTimesin interfaceorg.bukkit.Server
-
getAverageTickTime
public double getAverageTickTime()- Specified by:
getAverageTickTimein interfaceorg.bukkit.Server
-
getAdvancement
public org.bukkit.advancement.Advancement getAdvancement(org.bukkit.NamespacedKey key) - Specified by:
getAdvancementin interfaceorg.bukkit.Server
-
advancementIterator
- Specified by:
advancementIteratorin interfaceorg.bukkit.Server
-
getUnsafe
Deprecated.- Specified by:
getUnsafein interfaceorg.bukkit.Server
-
createBlockData
@NotNull public @NotNull org.bukkit.block.data.BlockData createBlockData(@NotNull @NotNull org.bukkit.Material material) - Specified by:
createBlockDatain interfaceorg.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:
createBlockDatain interfaceorg.bukkit.Server
-
createBlockData
- Specified by:
createBlockDatain interfaceorg.bukkit.Server
-
createBlockData
- Specified by:
createBlockDatain interfaceorg.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 MockTagfor theMaterialclass.
Call this in advance before you are gonna accessgetTag(String, NamespacedKey, Class)or any of the constants defined inTag.- Parameters:
key- TheNamespacedKeyfor thisTagregistryKey- The name of theTagRegistry.materials-Materialswhich should be covered by thisTag- Returns:
- The newly created
Tag
-
addTagRegistry
-
getTag
public <T extends org.bukkit.Keyed> org.bukkit.Tag<T> getTag(String registryKey, org.bukkit.NamespacedKey key, Class<T> clazz) - Specified by:
getTagin interfaceorg.bukkit.Server
-
getLootTable
public org.bukkit.loot.LootTable getLootTable(org.bukkit.NamespacedKey key) - Specified by:
getLootTablein interfaceorg.bukkit.Server
-
createExplorerMap
public org.bukkit.inventory.ItemStack createExplorerMap(org.bukkit.World world, org.bukkit.Location location, org.bukkit.StructureType structureType) - Specified by:
createExplorerMapin interfaceorg.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:
createExplorerMapin interfaceorg.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:
createBossBarin interfaceorg.bukkit.Server
-
getBossBars
- Specified by:
getBossBarsin interfaceorg.bukkit.Server
-
getBossBar
public org.bukkit.boss.KeyedBossBar getBossBar(org.bukkit.NamespacedKey key) - Specified by:
getBossBarin interfaceorg.bukkit.Server
-
removeBossBar
public boolean removeBossBar(org.bukkit.NamespacedKey key) - Specified by:
removeBossBarin interfaceorg.bukkit.Server
-
selectEntities
public List<org.bukkit.entity.Entity> selectEntities(org.bukkit.command.CommandSender sender, String selector) - Specified by:
selectEntitiesin interfaceorg.bukkit.Server
-
getStructureManager
@NotNull public @NotNull org.bukkit.structure.StructureManager getStructureManager()- Specified by:
getStructureManagerin interfaceorg.bukkit.Server
-
getMap
Deprecated.- Specified by:
getMapin interfaceorg.bukkit.Server
-
getTags
public <T extends org.bukkit.Keyed> Iterable<org.bukkit.Tag<T>> getTags(String registry, Class<T> clazz) - Specified by:
getTagsin interfaceorg.bukkit.Server
-
getTicksPerWaterSpawns
Deprecated.- Specified by:
getTicksPerWaterSpawnsin interfaceorg.bukkit.Server
-
getTicksPerAmbientSpawns
Deprecated.- Specified by:
getTicksPerAmbientSpawnsin interfaceorg.bukkit.Server
-
getCurrentServerTime
protected long getCurrentServerTime()This returns the current time of theServerin milliseconds- Returns:
- The current
Servertime
-
getTicksPerWaterAmbientSpawns
public int getTicksPerWaterAmbientSpawns()- Specified by:
getTicksPerWaterAmbientSpawnsin interfaceorg.bukkit.Server
-
getTicksPerWaterUndergroundCreatureSpawns
Deprecated.- Specified by:
getTicksPerWaterUndergroundCreatureSpawnsin interfaceorg.bukkit.Server
-
getWaterAmbientSpawnLimit
Deprecated.- Specified by:
getWaterAmbientSpawnLimitin interfaceorg.bukkit.Server
-
getWaterUndergroundCreatureSpawnLimit
Deprecated.- Specified by:
getWaterUndergroundCreatureSpawnLimitin interfaceorg.bukkit.Server
-
getMaxWorldSize
public int getMaxWorldSize()- Specified by:
getMaxWorldSizein interfaceorg.bukkit.Server
-
getSimulationDistance
public int getSimulationDistance()- Specified by:
getSimulationDistancein interfaceorg.bukkit.Server
-
getHideOnlinePlayers
public boolean getHideOnlinePlayers()- Specified by:
getHideOnlinePlayersin interfaceorg.bukkit.Server
-
spigot
public org.bukkit.Server.Spigot spigot()- Specified by:
spigotin interfaceorg.bukkit.Server
-
reloadPermissions
public void reloadPermissions()- Specified by:
reloadPermissionsin interfaceorg.bukkit.Server
-
reloadCommandAliases
public boolean reloadCommandAliases()- Specified by:
reloadCommandAliasesin interfaceorg.bukkit.Server
-
suggestPlayerNamesWhenNullTabCompletions
public boolean suggestPlayerNamesWhenNullTabCompletions()- Specified by:
suggestPlayerNamesWhenNullTabCompletionsin interfaceorg.bukkit.Server
-
getPermissionMessage
- Specified by:
getPermissionMessagein interfaceorg.bukkit.Server
-
permissionMessage
@NotNull public @NotNull net.kyori.adventure.text.Component permissionMessage()- Specified by:
permissionMessagein interfaceorg.bukkit.Server
-
createProfile
- Specified by:
createProfilein interfaceorg.bukkit.Server
-
createProfile
- Specified by:
createProfilein interfaceorg.bukkit.Server
-
createProfile
@NotNull public @NotNull PlayerProfileMock createProfile(@Nullable @Nullable UUID uuid, @Nullable @Nullable String name) - Specified by:
createProfilein interfaceorg.bukkit.Server
-
createProfileExact
@NotNull public @NotNull PlayerProfileMock createProfileExact(@Nullable @Nullable UUID uuid, @Nullable @Nullable String name) - Specified by:
createProfileExactin interfaceorg.bukkit.Server
-
getCurrentTick
public int getCurrentTick()- Specified by:
getCurrentTickin interfaceorg.bukkit.Server
-
isStopping
public boolean isStopping()- Specified by:
isStoppingin interfaceorg.bukkit.Server
-
getMobGoals
@NotNull public @NotNull com.destroystokyo.paper.entity.ai.MobGoals getMobGoals()- Specified by:
getMobGoalsin interfaceorg.bukkit.Server
-
getDatapackManager
@NotNull public @NotNull io.papermc.paper.datapack.DatapackManager getDatapackManager()- Specified by:
getDatapackManagerin interfaceorg.bukkit.Server
-
getConfig
@NotNull public @NotNull org.bukkit.configuration.file.YamlConfiguration getConfig()- Overrides:
getConfigin classorg.bukkit.Server.Spigot
-
broadcast
@Deprecated public void broadcast(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent component) Deprecated.- Specified by:
broadcastin interfaceorg.bukkit.Server- Overrides:
broadcastin classorg.bukkit.Server.Spigot
-
broadcast
@Deprecated public void broadcast(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent... components) Deprecated.- Specified by:
broadcastin interfaceorg.bukkit.Server- Overrides:
broadcastin classorg.bukkit.Server.Spigot
-
restart
public void restart()- Overrides:
restartin classorg.bukkit.Server.Spigot
-
getTicksPerSpawns
public int getTicksPerSpawns(@NotNull @NotNull org.bukkit.entity.SpawnCategory spawnCategory) - Specified by:
getTicksPerSpawnsin interfaceorg.bukkit.Server
-
createPlayerProfile
@Deprecated @NotNull public @NotNull PlayerProfileMock createPlayerProfile(@Nullable @Nullable UUID uniqueId, @Nullable @Nullable String name) Deprecated.- Specified by:
createPlayerProfilein interfaceorg.bukkit.Server
-
createPlayerProfile
@Deprecated @NotNull public @NotNull PlayerProfileMock createPlayerProfile(@NotNull @NotNull UUID uniqueId) Deprecated.- Specified by:
createPlayerProfilein interfaceorg.bukkit.Server
-
createPlayerProfile
@Deprecated @NotNull public @NotNull PlayerProfileMock createPlayerProfile(@NotNull @NotNull String name) Deprecated.- Specified by:
createPlayerProfilein interfaceorg.bukkit.Server
-
getSpawnLimit
public int getSpawnLimit(@NotNull @NotNull org.bukkit.entity.SpawnCategory spawnCategory) - Specified by:
getSpawnLimitin interfaceorg.bukkit.Server
-
getPotionBrewer
@NotNull public @NotNull org.bukkit.potion.PotionBrewer getPotionBrewer()- Specified by:
getPotionBrewerin interfaceorg.bukkit.Server
-
getPluginsFolder
- Specified by:
getPluginsFolderin interfaceorg.bukkit.Server
-
audiences
- Specified by:
audiencesin interfacenet.kyori.adventure.audience.ForwardingAudience
-