Package be.seeseemelk.mockbukkit
Class ServerMock
java.lang.Object
org.bukkit.Server.Spigot
be.seeseemelk.mockbukkit.ServerMock
- All Implemented Interfaces:
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 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>voidChecks if we are running a method on the main thread.voidvoidbroadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) voidbroadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) intintbroadcastMessage(String message) void@NotNull org.bukkit.inventory.ItemStackcraftItem(@NotNull org.bukkit.inventory.ItemStack[] craftingMatrix, @NotNull org.bukkit.World world, @NotNull org.bukkit.entity.Player player) org.bukkit.block.data.BlockDatacreateBlockData(String data) org.bukkit.block.data.BlockDatacreateBlockData(org.bukkit.Material material) org.bukkit.block.data.BlockDatacreateBlockData(org.bukkit.Material material, String data) org.bukkit.block.data.BlockDatacreateBlockData(org.bukkit.Material material, Consumer<org.bukkit.block.data.BlockData> consumer) 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) org.bukkit.generator.ChunkGenerator.ChunkDatacreateChunkData(org.bukkit.World world) 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) createInventory(org.bukkit.inventory.InventoryHolder owner, int size) createInventory(org.bukkit.inventory.InventoryHolder owner, int size, String title) 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) @NotNull InventoryMockcreateInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type, String title, int size) org.bukkit.map.MapViewcreateMap(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(String title) org.bukkit.profile.PlayerProfilecreatePlayerProfile(@NotNull String name) org.bukkit.profile.PlayerProfilecreatePlayerProfile(@NotNull UUID uniqueId) org.bukkit.profile.PlayerProfilecreatePlayerProfile(@Nullable UUID uniqueId, @Nullable String name) org.bukkit.WorldcreateWorld(org.bukkit.WorldCreator creator) booleandispatchCommand(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) booleanbooleanbooleanintintorg.bukkit.BanListgetBanList(org.bukkit.BanList.Type type) Set<org.bukkit.OfflinePlayer>org.bukkit.boss.KeyedBossBargetBossBar(org.bukkit.NamespacedKey key) Iterator<org.bukkit.boss.KeyedBossBar>@NotNull MockCommandMap@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 millisecondsorg.bukkit.GameMode@NotNull Set<EntityMock>Returns a set of entities that exist on the server instance.@Nullable org.bukkit.entity.EntitybooleanbooleanintgetIp()org.bukkit.inventory.ItemFactoryorg.bukkit.loot.LootTablegetLootTable(org.bukkit.NamespacedKey key) org.bukkit.map.MapViewgetMap(int id) intintorg.bukkit.plugin.messaging.MessengerintgetMotd()getName()org.bukkit.OfflinePlayergetOfflinePlayer(String name) org.bukkit.OfflinePlayergetOfflinePlayer(UUID id) org.bukkit.OfflinePlayer[]booleanCollection<? extends PlayerMock>Set<org.bukkit.OfflinePlayer>getPlayer(int num) Get a specific mock player.org.bukkit.entity.Playerorg.bukkit.entity.Playerorg.bukkit.entity.PlayergetPlayerExact(String name) org.bukkit.command.PluginCommandgetPluginCommand(String name) intgetPort()org.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.CachedServerIconintintgetSpawnLimit(@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>>intintintintgetTicksPerSpawns(@NotNull org.bukkit.entity.SpawnCategory spawnCategory) intintintDeprecated.int@NotNull org.bukkit.Warning.WarningStateintintintSet<org.bukkit.OfflinePlayer>org.bukkit.Worldorg.bukkit.WorldList<org.bukkit.World>booleanbooleanbooleanChecks if we are on the main thread.booleanbooleanbooleanorg.bukkit.util.CachedServerIconloadServerIcon(BufferedImage image) org.bukkit.util.CachedServerIconloadServerIcon(File file) List<org.bukkit.entity.Player>matchPlayer(String name) 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()voidvoidbooleanremoveBossBar(org.bukkit.NamespacedKey key) booleanremoveRecipe(org.bukkit.NamespacedKey key) voidvoidrestart()voidList<org.bukkit.entity.Entity>selectEntities(org.bukkit.command.CommandSender sender, String selector) voidsendPluginMessage(org.bukkit.plugin.Plugin source, String channel, byte[] message) voidsetDefaultGameMode(org.bukkit.GameMode mode) voidsetIdleTimeout(int threshold) 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()org.bukkit.Server.Spigotspigot()voidbooleanunloadWorld(String name, boolean save) booleanunloadWorld(org.bukkit.World world, boolean save)
-
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.
-
assertMainThread
public void assertMainThread()Checks if we are running a method on the main thread. If not, a `ThreadAccessException` is thrown. -
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.
-
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
-
getOnlinePlayers
- Specified by:
getOnlinePlayersin interfaceorg.bukkit.Server
-
getOfflinePlayers
public org.bukkit.OfflinePlayer[] getOfflinePlayers()- Specified by:
getOfflinePlayersin 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
-
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
-
createInventory
@NotNull public @NotNull InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type, String title, int size) -
createInventory
public InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type) - Specified by:
createInventoryin interfaceorg.bukkit.Server
-
createInventory
public InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, org.bukkit.event.inventory.InventoryType type, String title) - Specified by:
createInventoryin interfaceorg.bukkit.Server
-
createInventory
- Specified by:
createInventoryin interfaceorg.bukkit.Server
-
createInventory
public InventoryMock createInventory(org.bukkit.inventory.InventoryHolder owner, int size, String title) - Specified by:
createInventoryin interfaceorg.bukkit.Server
-
getItemFactory
public org.bukkit.inventory.ItemFactory 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
-
getScheduler
- Specified by:
getSchedulerin interfaceorg.bukkit.Server
-
getMaxPlayers
public int getMaxPlayers()- Specified by:
getMaxPlayersin 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
public org.bukkit.BanList getBanList(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
- Specified by:
broadcastMessagein interfaceorg.bukkit.Server
-
broadcast
- 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
-
getHelpMap
- Specified by:
getHelpMapin interfaceorg.bukkit.Server
-
sendPluginMessage
- 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
public int getTicksPerAnimalSpawns()- Specified by:
getTicksPerAnimalSpawnsin interfaceorg.bukkit.Server
-
getTicksPerMonsterSpawns
public int getTicksPerMonsterSpawns()- 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
public org.bukkit.map.MapView createMap(org.bukkit.World world) - 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
- 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
public org.bukkit.plugin.messaging.Messenger getMessenger()- Specified by:
getMessengerin interfaceorg.bukkit.Server
-
createMerchant
- Specified by:
createMerchantin interfaceorg.bukkit.Server
-
getMonsterSpawnLimit
public int getMonsterSpawnLimit()- Specified by:
getMonsterSpawnLimitin interfaceorg.bukkit.Server
-
getAnimalSpawnLimit
public int getAnimalSpawnLimit()- Specified by:
getAnimalSpawnLimitin interfaceorg.bukkit.Server
-
getWaterAnimalSpawnLimit
public int getWaterAnimalSpawnLimit()- Specified by:
getWaterAnimalSpawnLimitin interfaceorg.bukkit.Server
-
getAmbientSpawnLimit
public int getAmbientSpawnLimit()- Specified by:
getAmbientSpawnLimitin interfaceorg.bukkit.Server
-
isPrimaryThread
public boolean isPrimaryThread()- Specified by:
isPrimaryThreadin interfaceorg.bukkit.Server
-
getMotd
- Specified by:
getMotdin interfaceorg.bukkit.Server
-
getShutdownMessage
- 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
public org.bukkit.generator.ChunkGenerator.ChunkData createChunkData(org.bukkit.World world) - Specified by:
createChunkDatain 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
-
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
public org.bukkit.block.data.BlockData createBlockData(org.bukkit.Material material) - Specified by:
createBlockDatain interfaceorg.bukkit.Server
-
createBlockData
public org.bukkit.block.data.BlockData createBlockData(org.bukkit.Material material, 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
public org.bukkit.map.MapView getMap(int id) - 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
public int getTicksPerWaterSpawns()- Specified by:
getTicksPerWaterSpawnsin interfaceorg.bukkit.Server
-
getTicksPerAmbientSpawns
public int getTicksPerAmbientSpawns()- 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
public int getTicksPerWaterUndergroundCreatureSpawns()- Specified by:
getTicksPerWaterUndergroundCreatureSpawnsin interfaceorg.bukkit.Server
-
getWaterAmbientSpawnLimit
public int getWaterAmbientSpawnLimit()- Specified by:
getWaterAmbientSpawnLimitin interfaceorg.bukkit.Server
-
getWaterUndergroundCreatureSpawnLimit
public int getWaterUndergroundCreatureSpawnLimit()- 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
-
getConfig
@NotNull public @NotNull org.bukkit.configuration.file.YamlConfiguration getConfig()- Overrides:
getConfigin classorg.bukkit.Server.Spigot
-
broadcast
public void broadcast(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent component) - Overrides:
broadcastin classorg.bukkit.Server.Spigot
-
broadcast
public void broadcast(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent... components) - 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
public org.bukkit.profile.PlayerProfile createPlayerProfile(@Nullable @Nullable UUID uniqueId, @Nullable @Nullable String name) - Specified by:
createPlayerProfilein interfaceorg.bukkit.Server
-
createPlayerProfile
- Specified by:
createPlayerProfilein interfaceorg.bukkit.Server
-
createPlayerProfile
- Specified by:
createPlayerProfilein interfaceorg.bukkit.Server
-
getSpawnLimit
public int getSpawnLimit(@NotNull @NotNull org.bukkit.entity.SpawnCategory spawnCategory) - Specified by:
getSpawnLimitin interfaceorg.bukkit.Server
-