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
Mock implementation of a
Server and Server.Spigot.-
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 TypeMethodDescription@NotNull PlayerMockCreates a random player and adds it.voidaddPlayer(@NotNull PlayerMock player) Add a specific player to the set.@NotNull PlayerMockCreates a player with a given name and adds it.booleanaddRecipe(@Nullable org.bukkit.inventory.Recipe recipe, boolean resendRecipes) booleanaddRecipe(org.bukkit.inventory.Recipe recipe) @NotNull WorldMockaddSimpleWorld(String name) Adds a very simple super flat world with a given name.voidaddTagRegistry(@NotNull TagRegistry registry) Adds a tag registry.voidAdds the given mocked world to this server.@NotNull Iterator<org.bukkit.advancement.Advancement> @NotNull Iterable<? extends net.kyori.adventure.audience.Audience> voidvoidbanIP(@NotNull InetAddress address) intDeprecated.intbroadcast(@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.intbroadcastMessage(@NotNull String message) Deprecated.void@NotNull org.bukkit.inventory.ItemStackcraftItem(@NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull org.bukkit.World world) @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.inventory.ItemCraftResultcraftItemResult(@NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull org.bukkit.World world) @NotNull org.bukkit.inventory.ItemCraftResultcraftItemResult(@NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull org.bukkit.World world, @NotNull org.bukkit.entity.Player player) @NotNull org.bukkit.block.data.BlockDatacreateBlockData(String data) @NotNull org.bukkit.block.data.BlockDatacreateBlockData(@NotNull org.bukkit.Material material) @NotNull org.bukkit.block.data.BlockDatacreateBlockData(@NotNull org.bukkit.Material material, @Nullable Consumer<? super org.bukkit.block.data.BlockData> consumer) @NotNull org.bukkit.block.data.BlockDatacreateBlockData(org.bukkit.Material material, String data) @NotNull org.bukkit.boss.BossBarcreateBossBar(@NotNull String title, @NotNull org.bukkit.boss.BarColor color, @NotNull org.bukkit.boss.BarStyle style, org.bukkit.boss.BarFlag... flags) @NotNull org.bukkit.boss.KeyedBossBarcreateBossBar(@NotNull org.bukkit.NamespacedKey key, @NotNull String title, @NotNull org.bukkit.boss.BarColor color, @NotNull 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) @Nullable org.bukkit.inventory.ItemStackcreateExplorerMap(@NotNull org.bukkit.World world, @NotNull org.bukkit.Location location, org.bukkit.generator.structure.StructureType structureType, org.bukkit.map.MapCursor.Type mapIcon, int radius, boolean findUnexplored) @NotNull org.bukkit.inventory.ItemStackcreateExplorerMap(org.bukkit.World world, org.bukkit.Location location, org.bukkit.StructureType structureType) @NotNull 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) @NotNull InventoryMockcreateInventory(org.bukkit.inventory.InventoryHolder owner, int size) @NotNull InventoryMockcreateInventory(org.bukkit.inventory.InventoryHolder owner, int size, String title) Deprecated.@NotNull InventoryMockcreateInventory(org.bukkit.inventory.InventoryHolder owner, @NotNull org.bukkit.event.inventory.InventoryType type) @NotNull InventoryMockcreateInventory(org.bukkit.inventory.InventoryHolder owner, @NotNull org.bukkit.event.inventory.InventoryType type, String title) Deprecated.@NotNull InventoryMockcreateInventory(org.bukkit.inventory.InventoryHolder owner, @NotNull 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.@NotNull org.bukkit.inventory.MerchantcreateMerchant(String title) Deprecated.@NotNull org.bukkit.inventory.MerchantcreateMerchant(@Nullable net.kyori.adventure.text.Component title) @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(@NotNull org.bukkit.WorldCreator creator) @NotNull org.bukkit.WorldBorderbooleandispatchCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull String commandLine) @NotNull CommandResultExecutes a command.@NotNull CommandResultexecute(@NotNull org.bukkit.command.Command command, org.bukkit.command.CommandSender sender, String... args) Executes a command.@NotNull CommandResultexecuteConsole(@NotNull String command, String... args) Executes a command as the console.@NotNull CommandResultexecuteConsole(@NotNull org.bukkit.command.Command command, String... args) Executes a command as the console.@NotNull CommandResultexecutePlayer(@NotNull String command, String... args) Executes a command as a player.@NotNull CommandResultexecutePlayer(@NotNull org.bukkit.command.Command command, String... args) Executes a command as a player.org.bukkit.advancement.AdvancementgetAdvancement(org.bukkit.NamespacedKey key) booleanbooleanbooleanintDeprecated.intDeprecated.@NotNull io.papermc.paper.threadedregions.scheduler.AsyncSchedulerdouble<B extends org.bukkit.BanList<E>,E>
BgetBanList(@NotNull io.papermc.paper.ban.BanListType<B> type) @NotNull org.bukkit.BanListgetBanList(@NotNull org.bukkit.BanList.Type type) @NotNull Set<org.bukkit.OfflinePlayer> org.bukkit.boss.KeyedBossBargetBossBar(org.bukkit.NamespacedKey key) @NotNull Iterator<org.bukkit.boss.KeyedBossBar> @NotNull String@NotNull MockCommandMapgetCommandTabComplete(@NotNull org.bukkit.command.CommandSender sender, @NotNull String commandLine) Gets the tab completion result for a command.@NotNull org.bukkit.configuration.file.YamlConfigurationlong@NotNull ConsoleCommandSenderMock@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.DatapackManager@NotNull org.bukkit.packs.DataPackManagerDeprecated.@NotNull org.bukkit.GameMode@NotNull Set<EntityMock> Returns a set of entities that exist on the server instance.@Nullable org.bukkit.entity.Entity@NotNull org.bukkit.entity.EntityFactoryboolean@NotNull io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler@NotNull HelpMapMockbooleanint@NotNull StringgetIp()@NotNull org.bukkit.inventory.ItemFactory@NotNull Loggerorg.bukkit.loot.LootTablegetLootTable(org.bukkit.NamespacedKey key) getMap(int id) Deprecated.intintint@NotNull org.bukkit.plugin.messaging.Messenger@NotNull String@NotNull com.destroystokyo.paper.entity.ai.MobGoalsintDeprecated.@NotNull StringgetMotd()Deprecated.@NotNull StringgetName()@NotNull org.bukkit.OfflinePlayergetOfflinePlayer(@NotNull String name) Deprecated.@NotNull org.bukkit.OfflinePlayergetOfflinePlayer(@NotNull UUID id) @Nullable org.bukkit.OfflinePlayergetOfflinePlayerIfCached(@NotNull String name) org.bukkit.OfflinePlayer @NotNull []boolean@NotNull Collection<? extends PlayerMock> @NotNull Set<org.bukkit.OfflinePlayer> @NotNull String@NotNull PlayerMockgetPlayer(int num) Get a specific mock player.org.bukkit.entity.Playerorg.bukkit.entity.Playerorg.bukkit.entity.PlayergetPlayerExact(@NotNull String name) @NotNull MockPlayerListReturns theMockPlayerListinstance that is used by this server.@Nullable UUIDgetPlayerUniqueId(@NotNull String playerName) org.bukkit.command.PluginCommandgetPluginCommand(@NotNull String name) @NotNull PluginManagerMock@NotNull FileintgetPort()@NotNull org.bukkit.potion.PotionBrewer@Nullable org.bukkit.inventory.RecipegetRecipe(@NotNull org.bukkit.NamespacedKey key) @NotNull List<org.bukkit.inventory.Recipe> getRecipesFor(@NotNull org.bukkit.inventory.ItemStack item) @NotNull io.papermc.paper.threadedregions.scheduler.RegionScheduler<T extends org.bukkit.Keyed>
@Nullable org.bukkit.Registry<T> getRegistry(@NotNull Class<T> tClass) @NotNull String@NotNull String@NotNull String@NotNull BukkitSchedulerMock@NotNull org.bukkit.scoreboard.CriteriagetScoreboardCriteria(@NotNull String name) @NotNull ScoreboardManagerMock@NotNull ServerConfigurationExposes theServerConfigurationof thisServerMock.@Nullable org.bukkit.packs.ResourcePack@NotNull org.bukkit.ServerTickManager@NotNull ServicesManagerMockDeprecated.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>
@NotNull 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()@NotNull MockUnsafeValuesDeprecated.@NotNull String@NotNull File@NotNull Stringint@NotNull org.bukkit.Warning.WarningStateintDeprecated.intDeprecated.intDeprecated.@NotNull Set<org.bukkit.OfflinePlayer> org.bukkit.Worldorg.bukkit.World@Nullable org.bukkit.WorldgetWorld(@NotNull org.bukkit.NamespacedKey worldKey) @NotNull File@NotNull List<org.bukkit.World> @NotNull StringbooleanbooleanbooleanbooleanbooleanbooleanChecks if we are on the main thread.booleanisOwnedByCurrentRegion(@NotNull org.bukkit.Location location) booleanisOwnedByCurrentRegion(@NotNull org.bukkit.Location location, int squareRadiusChunks) booleanisOwnedByCurrentRegion(@NotNull org.bukkit.World world, int chunkX, int chunkZ) booleanisOwnedByCurrentRegion(@NotNull org.bukkit.World world, int chunkX, int chunkZ, int squareRadiusChunks) booleanisOwnedByCurrentRegion(@NotNull org.bukkit.World world, @NotNull io.papermc.paper.math.Position position) booleanisOwnedByCurrentRegion(@NotNull org.bukkit.World world, @NotNull io.papermc.paper.math.Position position, int squareRadiusChunks) booleanisOwnedByCurrentRegion(@NotNull org.bukkit.entity.Entity entity) booleanbooleanbooleanbooleanboolean@NotNull CachedServerIconMockloadServerIcon(@NotNull BufferedImage image) @NotNull CachedServerIconMockloadServerIcon(@NotNull File file) @NotNull List<org.bukkit.entity.Player> matchPlayer(@NotNull String name) @NotNull net.kyori.adventure.text.Componentmotd()voidmotd(@NotNull net.kyori.adventure.text.Component motd) @NotNull net.kyori.adventure.text.Component@NotNull Iterator<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(@NotNull org.bukkit.NamespacedKey key) booleanremoveRecipe(@NotNull org.bukkit.NamespacedKey key, boolean resendRecipes) booleanremoveWorld(WorldMock world) Removes a mocked world from this server.voidvoidrestart()void@NotNull List<org.bukkit.entity.Entity> selectEntities(org.bukkit.command.CommandSender sender, String selector) voidsendPluginMessage(@NotNull org.bukkit.plugin.Plugin source, @NotNull String channel, byte[] message) voidsetAllowEnd(boolean allowEnd) Sets whether the End should be allowed.voidsetAllowFlight(boolean allowFlight) Sets whether the server should allow flight.voidsetAllowNether(boolean allowNether) Sets whether the Nether should be allowed.voidsetDefaultGameMode(org.bukkit.GameMode mode) voidsetEnforcingSecureProfiles(boolean enforcingSecureProfiles) Sets whether the server should enforce secure profiles.voidsetGenerateStructures(boolean generateStructures) Sets whether structures should be generated.voidsetHardcore(boolean hardcore) Sets whether the server should be in hardcore mode.voidsetHideOnlinePlayers(boolean hideOnlinePlayers) Set whether to hide online playersvoidsetIdleTimeout(int threshold) voidSets the server listen IP.voidsetMaxChainedNeighborUpdates(int maxChainedNeighborUpdates) Sets the maximum number of chained neighbour updates before skipping additional ones.voidsetMaxPlayers(int maxPlayers) voidsetMaxWorldSize(int maxWorldSize) Set the maximum world sizevoidvoidsetOfflinePlayers(int num) Set the numbers of mock offline players that are on this server.voidsetOnlineMode(boolean onlineMode) Sets whether the server should be in online mode.voidsetPlayers(int num) Set the numbers of mock players that are on this server.voidsetPort(int port) Sets the server listen port.voidsetServerIcon(CachedServerIconMock serverIcon) Sets the return value ofgetServerIcon().voidsetShouldSendChatPreviews(boolean shouldSendChatPreviews) Deprecated, for removal: This API element is subject to removal in a future version.Chat previews were removed in 1.19.3.voidsetShutdownMessage(@NotNull net.kyori.adventure.text.Component shutdownMessage) Sets the shutdown message.voidsetSimulationDistance(int simulationDistance) Set the simulation distancevoidsetSpawnRadius(int spawnRadius) voidsetUpdateFolder(@NotNull String updateFolder) Sets the global update folder.voidsetViewDistance(int viewDistance) Sets the global view distance for all players.voidsetWarningState(@NotNull org.bukkit.Warning.WarningState warningState) Sets the return value ofgetWarningState().voidsetWhitelist(boolean value) voidsetWhitelistEnforced(boolean value) voidsetWorldType(ServerConfiguration.LevelType worldType) Sets the global default World TypebooleanDeprecated, for removal: This API element is subject to removal in a future version.Chat previews were removed in 1.19.3.voidshutdown()@Nullable net.kyori.adventure.text.Component@NotNull org.bukkit.Server.Spigotspigot()booleanvoidvoidunbanIP(@NotNull InetAddress address) booleanunloadWorld(String name, boolean save) booleanunloadWorld(org.bukkit.World world, boolean save) voidunregisterEntity(@NotNull EntityMock entity) Unregisters an entity from the server.voidvoidMethods 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
deleteMessage, openBook, removeResourcePacks, removeResourcePacks, removeResourcePacks, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, showTitle, stopSoundMethods inherited from interface net.kyori.adventure.audience.ForwardingAudience
clearResourcePacks, clearTitle, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, playSound, playSound, playSound, pointers, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendTitlePart, showBossBar, stopSoundMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFromMethods inherited from interface org.bukkit.Server
createExplorerMap, isOwnedByCurrentRegion
-
Constructor Details
-
ServerMock
public ServerMock()Constructs a new ServerMock and sets it up. Does NOT set the server returned fromBukkit.getServer().
-
-
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
-
unregisterEntity
Unregisters an entity from the server. Should only be used internally.- Parameters:
entity- The entity to unregister
-
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.
-
removeWorld
Removes a mocked world from this server.- Parameters:
world- The world to remove.- Returns:
- true if the world was removed, otherwise false.
-
executeConsole
@NotNull public @NotNull CommandResult executeConsole(@NotNull @NotNull 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
@NotNull public @NotNull CommandResult executeConsole(@NotNull @NotNull 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
@NotNull public @NotNull CommandResult executePlayer(@NotNull @NotNull 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
@NotNull public @NotNull CommandResult executePlayer(@NotNull @NotNull 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
@NotNull public @NotNull CommandResult execute(@NotNull @NotNull 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
@NotNull public @NotNull CommandResult execute(@NotNull @NotNull 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 @NotNull [] 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
- 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, @NotNull @NotNull org.bukkit.event.inventory.InventoryType type, String title, int size) Deprecated.Creates an inventory with the provided parameters.- Parameters:
owner- The holder of the inventory.type- The type of the inventory.title- The title of the inventory view.size- The size of the inventory.- Returns:
- The created inventory.
- Throws:
IllegalArgumentException- If the InventoryType is not creatable.- See Also:
-
createInventory
@NotNull public @NotNull InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, @NotNull @NotNull 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 @NotNull public @NotNull InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, @NotNull @NotNull org.bukkit.event.inventory.InventoryType type, String title) Deprecated.- Specified by:
createInventoryin interfaceorg.bukkit.Server
-
createInventory
@NotNull public @NotNull InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, int size) - 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 @NotNull public @NotNull InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, int size, String title) Deprecated.- Specified by:
createInventoryin interfaceorg.bukkit.Server
-
createMerchant
@NotNull public @NotNull org.bukkit.inventory.Merchant createMerchant(@Nullable @Nullable net.kyori.adventure.text.Component title) - Specified by:
createMerchantin interfaceorg.bukkit.Server
-
getItemFactory
@NotNull public @NotNull org.bukkit.inventory.ItemFactory getItemFactory()- Specified by:
getItemFactoryin interfaceorg.bukkit.Server
-
getWorlds
- Specified by:
getWorldsin interfaceorg.bukkit.Server
-
isTickingWorlds
public boolean isTickingWorlds()- Specified by:
isTickingWorldsin 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
-
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
@NotNull public @NotNull 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 public int broadcast(@NotNull @NotNull String message, @NotNull @NotNull String permission) 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
-
addRecipe
public boolean addRecipe(@Nullable @Nullable org.bukkit.inventory.Recipe recipe, boolean resendRecipes) - Specified by:
addRecipein interfaceorg.bukkit.Server
-
getRecipesFor
@NotNull public @NotNull List<org.bukkit.inventory.Recipe> getRecipesFor(@NotNull @NotNull org.bukkit.inventory.ItemStack item) - Specified by:
getRecipesForin interfaceorg.bukkit.Server
-
getRecipe
@Nullable public @Nullable org.bukkit.inventory.Recipe getRecipe(@NotNull @NotNull 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
-
craftItemResult
@NotNull public @NotNull org.bukkit.inventory.ItemCraftResult craftItemResult(@NotNull @NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull @NotNull org.bukkit.World world) - Specified by:
craftItemResultin interfaceorg.bukkit.Server
-
craftItemResult
@NotNull public @NotNull org.bukkit.inventory.ItemCraftResult craftItemResult(@NotNull @NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull @NotNull org.bukkit.World world, @NotNull @NotNull org.bukkit.entity.Player player) - Specified by:
craftItemResultin 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) - Specified by:
craftItemin interfaceorg.bukkit.Server
-
removeRecipe
public boolean removeRecipe(@NotNull @NotNull org.bukkit.NamespacedKey key) - Specified by:
removeRecipein interfaceorg.bukkit.Server
-
removeRecipe
public boolean removeRecipe(@NotNull @NotNull org.bukkit.NamespacedKey key, boolean resendRecipes) - Specified by:
removeRecipein interfaceorg.bukkit.Server
-
recipeIterator
- Specified by:
recipeIteratorin interfaceorg.bukkit.Server
-
clearRecipes
public void clearRecipes()- Specified by:
clearRecipesin interfaceorg.bukkit.Server
-
dispatchCommand
public boolean dispatchCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String commandLine) - Specified by:
dispatchCommandin interfaceorg.bukkit.Server
-
getCommandTabComplete
@NotNull public @NotNull List<String> getCommandTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String commandLine) Gets the tab completion result for a command.- Parameters:
sender- The command sender.commandLine- The command string, without a leading slash.- Returns:
- The tab completion result, or an empty list.
-
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
-
setPort
public void setPort(int port) Sets the server listen port.- Parameters:
port- The server listen port.- See Also:
-
getViewDistance
public int getViewDistance()- Specified by:
getViewDistancein interfaceorg.bukkit.Server
-
setViewDistance
public void setViewDistance(int viewDistance) Sets the global view distance for all players.- Parameters:
viewDistance- The new view distance.- See Also:
-
getIp
- Specified by:
getIpin interfaceorg.bukkit.Server
-
setIp
Sets the server listen IP.- Parameters:
serverIp- The server listen IP.- See Also:
-
getWorldType
- Specified by:
getWorldTypein interfaceorg.bukkit.Server
-
setWorldType
Sets the global default World Type- Parameters:
worldType- The newServerConfiguration.LevelType- See Also:
-
getGenerateStructures
public boolean getGenerateStructures()- Specified by:
getGenerateStructuresin interfaceorg.bukkit.Server
-
setGenerateStructures
public void setGenerateStructures(boolean generateStructures) Sets whether structures should be generated.- Parameters:
generateStructures- Whether structures should be generated.- See Also:
-
getAllowEnd
public boolean getAllowEnd()- Specified by:
getAllowEndin interfaceorg.bukkit.Server
-
setAllowEnd
public void setAllowEnd(boolean allowEnd) Sets whether the End should be allowed.- Parameters:
allowEnd- Whether the End should be allowed.- See Also:
-
getAllowNether
public boolean getAllowNether()- Specified by:
getAllowNetherin interfaceorg.bukkit.Server
-
isLoggingIPs
public boolean isLoggingIPs()- Specified by:
isLoggingIPsin interfaceorg.bukkit.Server
-
getInitialEnabledPacks
- Specified by:
getInitialEnabledPacksin interfaceorg.bukkit.Server
-
getInitialDisabledPacks
- Specified by:
getInitialDisabledPacksin interfaceorg.bukkit.Server
-
getDataPackManager
@Deprecated(since="1.19") @NotNull public @NotNull org.bukkit.packs.DataPackManager getDataPackManager()Deprecated.- Specified by:
getDataPackManagerin interfaceorg.bukkit.Server
-
getServerTickManager
@NotNull public @NotNull org.bukkit.ServerTickManager getServerTickManager()- Specified by:
getServerTickManagerin interfaceorg.bukkit.Server
-
getServerResourcePack
@Nullable public @Nullable org.bukkit.packs.ResourcePack getServerResourcePack()- Specified by:
getServerResourcePackin interfaceorg.bukkit.Server
-
setAllowNether
public void setAllowNether(boolean allowNether) Sets whether the Nether should be allowed.- Parameters:
allowNether- Whether the Nether should be allowed.- See Also:
-
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
-
setUpdateFolder
Sets the global update folder.- Parameters:
updateFolder- The new update folder.- See Also:
-
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(@NotNull @NotNull 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
-
updateResources
public void updateResources()- Specified by:
updateResourcesin interfaceorg.bukkit.Server
-
updateRecipes
public void updateRecipes()- Specified by:
updateRecipesin 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
-
shouldSendChatPreviews
Deprecated, for removal: This API element is subject to removal in a future version.Chat previews were removed in 1.19.3.- Specified by:
shouldSendChatPreviewsin interfaceorg.bukkit.Server- Returns:
- true if the server should send a preview, false otherwise
-
setShouldSendChatPreviews
Deprecated, for removal: This API element is subject to removal in a future version.Chat previews were removed in 1.19.3.Sets whether the server should send chat previews.- Parameters:
shouldSendChatPreviews- Whether the server should send chat previews.- See Also:
-
isEnforcingSecureProfiles
public boolean isEnforcingSecureProfiles()- Specified by:
isEnforcingSecureProfilesin interfaceorg.bukkit.Server
-
setEnforcingSecureProfiles
public void setEnforcingSecureProfiles(boolean enforcingSecureProfiles) Sets whether the server should enforce secure profiles.- Parameters:
enforcingSecureProfiles- Whether the server should enforce secure profiles.- See Also:
-
getOnlineMode
public boolean getOnlineMode()- Specified by:
getOnlineModein interfaceorg.bukkit.Server
-
setOnlineMode
public void setOnlineMode(boolean onlineMode) Sets whether the server should be in online mode.- Parameters:
onlineMode- Whether the server should be in online mode.- See Also:
-
getAllowFlight
public boolean getAllowFlight()- Specified by:
getAllowFlightin interfaceorg.bukkit.Server
-
setAllowFlight
public void setAllowFlight(boolean allowFlight) Sets whether the server should allow flight.- Parameters:
allowFlight- Whether the server should allow flight.- See Also:
-
isHardcore
public boolean isHardcore()- Specified by:
isHardcorein interfaceorg.bukkit.Server
-
setHardcore
public void setHardcore(boolean hardcore) Sets whether the server should be in hardcore mode.- Parameters:
hardcore- Whether the server should be in hardcore mode.- See Also:
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceorg.bukkit.Server
-
getOfflinePlayer
@Deprecated @NotNull public @NotNull org.bukkit.OfflinePlayer getOfflinePlayer(@NotNull @NotNull String name) Deprecated.- Specified by:
getOfflinePlayerin interfaceorg.bukkit.Server
-
getOfflinePlayer
- Specified by:
getOfflinePlayerin interfaceorg.bukkit.Server
-
getBannedPlayers
- Specified by:
getBannedPlayersin interfaceorg.bukkit.Server
-
getBanList
@NotNull public <B extends org.bukkit.BanList<E>,E> B getBanList(@NotNull @NotNull io.papermc.paper.ban.BanListType<B> type) - Specified by:
getBanListin 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
-
getMaxChainedNeighborUpdates
public int getMaxChainedNeighborUpdates()- Specified by:
getMaxChainedNeighborUpdatesin interfaceorg.bukkit.Server
-
setMaxChainedNeighborUpdates
public void setMaxChainedNeighborUpdates(int maxChainedNeighborUpdates) Sets the maximum number of chained neighbour updates before skipping additional ones. Negative values remove the limit.- Parameters:
maxChainedNeighborUpdates- The maximum number of chained neighbour updates.- See Also:
-
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
-
motd
public void motd(@NotNull @NotNull net.kyori.adventure.text.Component motd) - Specified by:
motdin interfaceorg.bukkit.Server
-
getMotd
Deprecated.- Specified by:
getMotdin interfaceorg.bukkit.Server
-
setMotd
- Specified by:
setMotdin interfaceorg.bukkit.Server
-
shutdownMessage
@Nullable public @Nullable net.kyori.adventure.text.Component shutdownMessage()- Specified by:
shutdownMessagein interfaceorg.bukkit.Server
-
setShutdownMessage
public void setShutdownMessage(@NotNull @NotNull net.kyori.adventure.text.Component shutdownMessage) Sets the shutdown message.- Parameters:
shutdownMessage- The shutdown message.- See Also:
-
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
-
getScoreboardCriteria
@NotNull public @NotNull org.bukkit.scoreboard.Criteria getScoreboardCriteria(@NotNull @NotNull String name) - Specified by:
getScoreboardCriteriain interfaceorg.bukkit.Server
-
setServerIcon
Sets the return value ofgetServerIcon().- Parameters:
serverIcon- The icon to set.
-
getServerIcon
- Specified by:
getServerIconin interfaceorg.bukkit.Server
-
loadServerIcon
@NotNull public @NotNull CachedServerIconMock loadServerIcon(@NotNull @NotNull File file) throws IOException - Specified by:
loadServerIconin interfaceorg.bukkit.Server- Throws:
IOException
-
loadServerIcon
@NotNull public @NotNull CachedServerIconMock loadServerIcon(@NotNull @NotNull BufferedImage image) throws IOException - Specified by:
loadServerIconin interfaceorg.bukkit.Server- Throws:
IOException
-
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
@NotNull public @NotNull org.bukkit.boss.BossBar createBossBar(@NotNull @NotNull String title, @NotNull @NotNull org.bukkit.boss.BarColor color, @NotNull @NotNull 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<? super org.bukkit.block.data.BlockData> consumer) - Specified by:
createBlockDatain interfaceorg.bukkit.Server
-
createBlockData
- Specified by:
createBlockDatain interfaceorg.bukkit.Server
-
createBlockData
@NotNull public @NotNull org.bukkit.block.data.BlockData createBlockData(org.bukkit.Material material, String data) - 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
Adds a tag registry.- Parameters:
registry- The registry to add.
-
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
@NotNull public @NotNull org.bukkit.inventory.ItemStack createExplorerMap(org.bukkit.World world, org.bukkit.Location location, org.bukkit.StructureType structureType) - Specified by:
createExplorerMapin interfaceorg.bukkit.Server
-
createExplorerMap
@NotNull public @NotNull 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
-
createExplorerMap
@Nullable public @Nullable org.bukkit.inventory.ItemStack createExplorerMap(@NotNull @NotNull org.bukkit.World world, @NotNull @NotNull org.bukkit.Location location, @NotNull org.bukkit.generator.structure.StructureType structureType, @NotNull org.bukkit.map.MapCursor.Type mapIcon, int radius, boolean findUnexplored) - Specified by:
createExplorerMapin interfaceorg.bukkit.Server
-
createBossBar
@NotNull public @NotNull org.bukkit.boss.KeyedBossBar createBossBar(@NotNull @NotNull org.bukkit.NamespacedKey key, @NotNull @NotNull String title, @NotNull @NotNull org.bukkit.boss.BarColor color, @NotNull @NotNull 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
@NotNull public @NotNull 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
-
getRegistry
@Nullable public <T extends org.bukkit.Keyed> @Nullable org.bukkit.Registry<T> getRegistry(@NotNull @NotNull Class<T> tClass) - Specified by:
getRegistryin interfaceorg.bukkit.Server
-
getMap
Deprecated.- Specified by:
getMapin interfaceorg.bukkit.Server
-
getTags
@NotNull public <T extends org.bukkit.Keyed> @NotNull 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
-
setMaxWorldSize
public void setMaxWorldSize(int maxWorldSize) Set the maximum world size- Parameters:
maxWorldSize- The maximum world size- See Also:
-
getSimulationDistance
public int getSimulationDistance()- Specified by:
getSimulationDistancein interfaceorg.bukkit.Server
-
setSimulationDistance
public void setSimulationDistance(int simulationDistance) Set the simulation distance- Parameters:
simulationDistance- The simulation distance- See Also:
-
getHideOnlinePlayers
public boolean getHideOnlinePlayers()- Specified by:
getHideOnlinePlayersin interfaceorg.bukkit.Server
-
setHideOnlinePlayers
public void setHideOnlinePlayers(boolean hideOnlinePlayers) Set whether to hide online players- Parameters:
hideOnlinePlayers- Whether to hide online players- See Also:
-
spigot
public @NotNull 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
-
getRegionScheduler
@NotNull public @NotNull io.papermc.paper.threadedregions.scheduler.RegionScheduler getRegionScheduler()- Specified by:
getRegionSchedulerin interfaceorg.bukkit.Server
-
getAsyncScheduler
@NotNull public @NotNull io.papermc.paper.threadedregions.scheduler.AsyncScheduler getAsyncScheduler()- Specified by:
getAsyncSchedulerin interfaceorg.bukkit.Server
-
getGlobalRegionScheduler
@NotNull public @NotNull io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler getGlobalRegionScheduler()- Specified by:
getGlobalRegionSchedulerin interfaceorg.bukkit.Server
-
isOwnedByCurrentRegion
public boolean isOwnedByCurrentRegion(@NotNull @NotNull org.bukkit.World world, @NotNull @NotNull io.papermc.paper.math.Position position) - Specified by:
isOwnedByCurrentRegionin interfaceorg.bukkit.Server
-
isOwnedByCurrentRegion
public boolean isOwnedByCurrentRegion(@NotNull @NotNull org.bukkit.World world, @NotNull @NotNull io.papermc.paper.math.Position position, int squareRadiusChunks) - Specified by:
isOwnedByCurrentRegionin interfaceorg.bukkit.Server
-
isOwnedByCurrentRegion
public boolean isOwnedByCurrentRegion(@NotNull @NotNull org.bukkit.Location location) - Specified by:
isOwnedByCurrentRegionin interfaceorg.bukkit.Server
-
isOwnedByCurrentRegion
public boolean isOwnedByCurrentRegion(@NotNull @NotNull org.bukkit.Location location, int squareRadiusChunks) - Specified by:
isOwnedByCurrentRegionin interfaceorg.bukkit.Server
-
isOwnedByCurrentRegion
public boolean isOwnedByCurrentRegion(@NotNull @NotNull org.bukkit.World world, int chunkX, int chunkZ) - Specified by:
isOwnedByCurrentRegionin interfaceorg.bukkit.Server
-
isOwnedByCurrentRegion
public boolean isOwnedByCurrentRegion(@NotNull @NotNull org.bukkit.World world, int chunkX, int chunkZ, int squareRadiusChunks) - Specified by:
isOwnedByCurrentRegionin interfaceorg.bukkit.Server
-
isOwnedByCurrentRegion
public boolean isOwnedByCurrentRegion(@NotNull @NotNull org.bukkit.entity.Entity entity) - Specified by:
isOwnedByCurrentRegionin interfaceorg.bukkit.Server
-
getPluginsFolder
- Specified by:
getPluginsFolderin interfaceorg.bukkit.Server
-
isAcceptingTransfers
public boolean isAcceptingTransfers()- Specified by:
isAcceptingTransfersin interfaceorg.bukkit.Server
-
getEntityFactory
@NotNull public @NotNull org.bukkit.entity.EntityFactory getEntityFactory()- Specified by:
getEntityFactoryin interfaceorg.bukkit.Server
-
audiences
- Specified by:
audiencesin interfacenet.kyori.adventure.audience.ForwardingAudience
-
getServerConfiguration
Exposes theServerConfigurationof thisServerMock.- Returns:
- The
ServerConfigurationof thisServerMock.
-