public interface Server extends PluginMessageRecipient
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
BROADCAST_CHANNEL_ADMINISTRATIVE
用于所有的操作命令,如控制台命令.
|
static java.lang.String |
BROADCAST_CHANNEL_USERS
用于所有的公告信息,如通知玩家已加入的用户.
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
addRecipe(Recipe recipe)
向服务器添加一个配方
原文:Adds a recipe to the crafting manager.
|
java.util.Iterator<Advancement> |
advancementIterator()
Get an iterator through all advancements.
|
void |
banIP(java.lang.String address)
设置禁止此ip地址登陆到服务器.
|
int |
broadcast(java.lang.String message,
java.lang.String permission)
向具有给定权限的玩家发送一条信息
原文:Broadcasts the specified message to every user with the given
permission name.
|
int |
broadcastMessage(java.lang.String message)
广播一条消息到所有玩家.
|
void |
clearRecipes()
清空配方
原文:Clears the list of crafting recipes.
|
BossBar |
createBossBar(java.lang.String title,
BarColor color,
BarStyle style,
BarFlag... flags)
创建一个Boos血量条实例。
|
ChunkGenerator.ChunkData |
createChunkData(World world)
创建一个 ChunkData 实例,以用于区块生成。
|
Inventory |
createInventory(InventoryHolder owner,
int size)
使用
InventoryType.CHEST 创建一个给定大小的Inventory
原文:Creates an empty inventory of type InventoryType.CHEST with the
specified size. |
Inventory |
createInventory(InventoryHolder owner,
int size,
java.lang.String title)
通过一个特定的大小和标题使用
InventoryType.CHEST 来创建一个空的物品栏
原文:Creates an empty inventory of type InventoryType.CHEST with the
specified size and title. |
Inventory |
createInventory(InventoryHolder owner,
InventoryType type)
通过一个特定的类型来创建一个空的物品栏,如果这个类型是
InventoryType.CHEST ,那么这个物品栏
的大小为27格(即0-26的slot可用),每个物品栏类型拥有其默认的大小
原文:Creates an empty inventory of the specified type. |
Inventory |
createInventory(InventoryHolder owner,
InventoryType type,
java.lang.String title)
通过一个特定的类型和标题来创建一个空的物品栏,如果这个类型是
InventoryType.CHEST ,那么这个物品栏
的大小为27格(即0-26的slot可用),每个物品栏类型拥有其默认的大小
原文:Creates an empty inventory with the specified type and title. |
MapView |
createMap(World world)
创建一个新的MapView实例并且自动分配ID
Create a new map with an automatically assigned ID.
|
Merchant |
createMerchant(java.lang.String title)
Creates an empty merchant.
|
World |
createWorld(WorldCreator creator)
使用给定的名字和配置来创建或者加载一个World
原文:Creates or loads a world with the given name using the specified
options.
|
boolean |
dispatchCommand(CommandSender sender,
java.lang.String commandLine)
在服务器执行一个命令
原文:Dispatches a command on this server, and executes it if found.
|
Advancement |
getAdvancement(NamespacedKey key)
Get the advancement specified by this key.
|
boolean |
getAllowEnd()
获取该服务器是否允许末地
原文:Gets whether this server allows the End or not.
|
boolean |
getAllowFlight()
获得服务器是否开启了飞行模式.
|
boolean |
getAllowNether()
Gets whether this server allows the Nether or not.
|
int |
getAmbientSpawnLimit()
获取一个区块最大生成环境怪物数(疑惑)
Gets user-specified limit for number of ambient mobs that can spawn in
a chunk.
|
int |
getAnimalSpawnLimit()
获取一个区块最大可生成动物数
原文:Gets user-specified limit for number of animals that can spawn in a
chunk.
|
BanList |
getBanList(BanList.Type type)
通过提供的BanList.Type来获取一个BanList
原文:Gets a ban list for the supplied type.
|
java.util.Set<OfflinePlayer> |
getBannedPlayers()
获得一组所有被服务器封禁的玩家.
|
java.lang.String |
getBukkitVersion()
获得服务器运行的Bukkit版本.
|
java.util.Map<java.lang.String,java.lang.String[]> |
getCommandAliases()
获取一个定义于服务器配置文件中的命令别名列表
原文:Gets a list of command aliases defined in the server properties.
|
long |
getConnectionThrottle()
获取玩家重连服务器的间隔(-1则为无限制)
原文:Gets the value of the connection throttle setting.
|
ConsoleCommandSender |
getConsoleSender()
获取一个
ConsoleCommandSender 将被作为服务器的标准输入(译注:该方法用于获取控制台) |
GameMode |
getDefaultGameMode()
获得新玩家的默认
GameMode . |
Entity |
getEntity(java.util.UUID uuid)
用UUID获取实体.
|
boolean |
getGenerateStructures()
获得是否允许生成器构造(对应server.properties文件中的generate-structures)
原文:Get generate-structures setting.
|
HelpMap |
getHelpMap()
|
int |
getIdleTimeout()
获取自动踢出闲置玩家的时间.
|
java.lang.String |
getIp()
获得当前服务器绑定的IP,当未设置时返回为空
原文:Get the IP that this server is bound to, or empty string if not
specified.
|
java.util.Set<java.lang.String> |
getIPBans()
获取一个被ban的IP的Set实例
原文:Gets a set containing all current IPs that are banned.
|
ItemFactory |
getItemFactory()
|
java.util.logging.Logger |
getLogger()
返回此服务器的日志记录.
|
MapView |
getMap(short id)
已过时。
不安全的参数
|
int |
getMaxPlayers()
获得服务器可同时在线玩家最高人数.
|
Messenger |
getMessenger()
|
int |
getMonsterSpawnLimit()
获取一个区块最大可生成怪物数
原文:Gets user-specified limit for number of monsters that can spawn in a
chunk.
|
java.lang.String |
getMotd()
获得服务器列表中服务器所显示的消息(服务器MOTD).
|
java.lang.String |
getName()
获得服务器名字.
|
OfflinePlayer |
getOfflinePlayer(java.lang.String name)
已过时。
UUID将会在不久后代替name
|
OfflinePlayer |
getOfflinePlayer(java.util.UUID id)
通过UUID获取OfflinePlayer实例
原文:Gets the player by the given UUID, regardless if they are offline or
online.
|
OfflinePlayer[] |
getOfflinePlayers()
获取所有登陆过服务器的玩家
原文:Gets every player that has ever played on this server.
|
boolean |
getOnlineMode()
获得服务器是否开启了正版模式.
|
java.util.Collection<? extends Player> |
getOnlinePlayers()
获得一个当前所有已登录玩家的集合.
|
java.util.Set<OfflinePlayer> |
getOperators()
获取一个包含所有OP的Set实例
原文:Gets a set containing all player operators.
|
Player |
getPlayer(java.lang.String name)
已过时。
请使用
getPlayer(UUID) 用玩家名查找无法保证唯一性 |
Player |
getPlayer(java.util.UUID id)
通过UUID获取玩家的实例
原文:Gets the player with the given UUID.
|
Player |
getPlayerExact(java.lang.String name)
已过时。
请使用
getPlayer(UUID) 用玩家名查找无法保证唯一性 |
PluginCommand |
getPluginCommand(java.lang.String name)
获取一个
PluginCommand 通过给定的name或者别称
原文:Gets a PluginCommand with the given name or alias. |
PluginManager |
getPluginManager()
获取PluginManager接口的实例
原文:Gets the plugin manager for interfacing with plugins.
|
int |
getPort()
获得服务器端口.
|
java.util.List<Recipe> |
getRecipesFor(ItemStack result)
获取一个合成ItemStack的所有配方,如果副ID为-1将匹配所有的数据值
原文:Get a list of all recipes for a given item.
|
BukkitScheduler |
getScheduler()
获取BukkitScheduler接口的实例用来安排任务
原文:Gets the scheduler for managing scheduled events.
|
ScoreboardManager |
getScoreboardManager()
获取ScoreboardManager实例
原文:Gets the instance of the scoreboard manager.
|
CachedServerIcon |
getServerIcon()
获取服务器默认图标
原文:Gets an instance of the server's default server-icon.
|
java.lang.String |
getServerId()
获得服务器的ID,该ID通常由数字和字母组成,这个ID可以用于识别服务器
原文:Get an ID of this server.
|
java.lang.String |
getServerName()
获得服务器名字.
|
ServicesManager |
getServicesManager()
获取ServicesManager
原文:Gets a services manager.
|
java.lang.String |
getShutdownMessage()
获取服务器关闭时给玩家发送的默认消息
原文:Gets the default message that is displayed when the server is stopped.
|
int |
getSpawnRadius()
获得此世界的出生点保护半径.
|
int |
getTicksPerAnimalSpawns()
获得每隔多少ticks生成动物
原文:Gets default ticks per animal spawns value.
|
int |
getTicksPerMonsterSpawns()
获得每隔多少ticks生成怪物
原文:Gets the default ticks per monster spawns value.
|
UnsafeValues |
getUnsafe()
已过时。
|
java.lang.String |
getUpdateFolder()
获取更新文件夹的名字.
|
java.io.File |
getUpdateFolderFile()
获取表示更新文件夹的 File 实例.
|
java.lang.String |
getVersion()
获得服务器版本字符串.
|
int |
getViewDistance()
获得当前设置的视距
原文:Get the view distance from this server.
|
Warning.WarningState |
getWarningState()
获取当前警告状态
原文:Gets the current warning state for the server.
|
int |
getWaterAnimalSpawnLimit()
获取一个区块最大可生成水生生物数
原文:Gets user-specified limit for number of water animals that can spawn in
a chunk.
|
java.util.Set<OfflinePlayer> |
getWhitelistedPlayers()
获得所有在白名单中的玩家.
|
World |
getWorld(java.lang.String name)
通过给定的name获取一个World实例
原文:Gets the world with the given name.
|
World |
getWorld(java.util.UUID uid)
通过UUID获取World实例
原文:Gets the world from the given Unique ID.
|
java.io.File |
getWorldContainer()
获取
World 的文件夹的File实例. |
java.util.List<World> |
getWorlds()
获取服务器以List封装的所有World
原文:Gets a list of all worlds on this server.
|
java.lang.String |
getWorldType()
获得主世界的世界类型(检测主世界的世界类型).
|
boolean |
hasWhitelist()
获取该服务器是否有白名单
原文:Gets whether this server has a whitelist or not.
|
boolean |
isHardcore()
获得服务器是否开启了极限生存模式.
|
boolean |
isPrimaryThread()
检查当前方法是否在主线程执行
原文:Checks the current thread against the expected primary thread for the
server.
|
CachedServerIcon |
loadServerIcon(java.awt.image.BufferedImage image)
从image中缓存为CachedServerIcon
原文:Creates a cached server-icon for the specific image.
|
CachedServerIcon |
loadServerIcon(java.io.File file)
从文件中缓存图片为CachedServerIcon
原文:Loads an image from a file, and returns a cached image for the specific
server-icon.
|
java.util.List<Player> |
matchPlayer(java.lang.String name)
已过时。
请使用
getPlayer(UUID) 用玩家名查找无法保证唯一性 |
java.util.Iterator<Recipe> |
recipeIterator()
获取配方迭代器
原文:Get an iterator through the list of crafting recipes.
|
void |
reload()
重新加载服务器并刷新设置和插件信息.
|
void |
reloadData()
只重载Minecraft游戏数据.
|
void |
reloadWhitelist()
重新加载服务器白名单配置.
|
void |
resetRecipes()
重置配方
原文:Resets the list of crafting recipes to the default.
|
void |
savePlayers()
将以记载的玩家储存到硬盘
原文:Writes loaded players to disk.
|
void |
setDefaultGameMode(GameMode mode)
设置新玩家的默认
GameMode . |
void |
setIdleTimeout(int threshold)
设置自动踢出闲置玩家的时间.
|
void |
setSpawnRadius(int value)
设置这个世界的出生点保护半径.
|
void |
setWhitelist(boolean value)
设置该服务器是是否开启白名单
原文:Sets if the server is whitelisted.
|
void |
shutdown()
彻底关闭服务器.
|
void |
unbanIP(java.lang.String address)
解除禁止此ip地址登陆到服务器.
|
boolean |
unloadWorld(java.lang.String name,
boolean save)
通过给定的名字从服务器卸载一个World
原文:Unloads a world with the given name.
|
boolean |
unloadWorld(World world,
boolean save)
通过给定的Wrold实例从服务器卸载一个World
原文:Unloads the given world.
|
getListeningPluginChannels, sendPluginMessage
static final java.lang.String BROADCAST_CHANNEL_ADMINISTRATIVE
原文:Used for all administrative messages, such as an operator using a command.
static final java.lang.String BROADCAST_CHANNEL_USERS
原文:Used for all announcement messages, such as informing users that a player has joined.
java.lang.String getName()
原文:Gets the name of this server implementation.
java.lang.String getVersion()
原文:Gets the version string of this server implementation.
java.lang.String getBukkitVersion()
原文:Gets the Bukkit version that this server is running.
java.util.Collection<? extends Player> getOnlinePlayers()
原文:Gets a view of all currently logged in players. This view is a reused
object, making some operations like Collection.size()
zero-allocation.
The collection is a view backed by the internal representation, such
that, changes to the internal state of the server will be reflected
immediately. However, the reuse of the returned collection (identity)
is not strictly guaranteed for future or all implementations. Casting
the collection, or relying on interface implementations (like Serializable
or List
), is deprecated.
Iteration behavior is undefined outside of self-contained main-thread
uses. Normal and immediate iterator use without consequences that
affect the collection are fully supported. The effects following
(non-exhaustive) teleportation
,
death
, and kicking
are undefined. Any use of this collection from
asynchronous threads is unsafe.
For safe consequential iteration or mimicking the old array behavior,
using Collection.toArray(Object[])
is recommended. For making
snapshots, ImmutableList#copyOf(Collection)
is recommended.
int getMaxPlayers()
原文:Get the maximum amount of players which can login to this server.
int getPort()
原文:Get the game port that the server runs on.
int getViewDistance()
原文:Get the view distance from this server.
java.lang.String getIp()
原文:Get the IP that this server is bound to, or empty string if not specified.
java.lang.String getServerName()
原文:Get the name of this server.
java.lang.String getServerId()
原文:Get an ID of this server. The ID is a simple generally alphanumeric ID that can be used for uniquely identifying this server.
java.lang.String getWorldType()
原文:Get world type (level-type setting) for default world.
boolean getGenerateStructures()
原文:Get generate-structures setting.
boolean getAllowEnd()
原文:Gets whether this server allows the End or not.
boolean getAllowNether()
boolean hasWhitelist()
原文:Gets whether this server has a whitelist or not.
void setWhitelist(boolean value)
原文:Sets if the server is whitelisted.
value
- 为true时则开启白名单,false则关闭白名单java.util.Set<OfflinePlayer> getWhitelistedPlayers()
原文:Gets a list of whitelisted players.
void reloadWhitelist()
原文:Reloads the whitelist from disk.
int broadcastMessage(java.lang.String message)
这与调用broadcast(java.lang.String,
java.lang.String)
(第二个参数为BROADCAST_CHANNEL_USERS
)相当。
原文:Broadcast a message to all players.
This is the same as calling broadcast(java.lang.String,
java.lang.String)
to BROADCAST_CHANNEL_USERS
message
- 要广播的消息java.lang.String getUpdateFolder()
更新文件夹相对于插件文件夹.
Tips:如何使用更新文件夹来实现更新您的插件呢?(服主和开发者都可以了解下):
The update folder name is relative to the plugins folder.
java.io.File getUpdateFolderFile()
原文: Gets the update folder. The update folder is used to safely update plugins at the right moment on a plugin load.
long getConnectionThrottle()
原文:Gets the value of the connection throttle setting.
int getTicksPerAnimalSpawns()
原文:Gets default ticks per animal spawns value.
示例:
注意:如果设置为0,动物生成将会被禁止,我们推荐使用spawn-animals代替用于控制动物生成
int getTicksPerMonsterSpawns()
原文:Gets the default ticks per monster spawns value.
示例:
注意:如果设置为0,动物生成将会被禁止,我们推荐使用spawn-monsters代替用于控制动物生成
@Deprecated Player getPlayer(java.lang.String name)
getPlayer(UUID)
用玩家名查找无法保证唯一性原文:Gets a player object by the given username.
这个方法不会返回不在线玩家的实例(意思就是说获取的玩家必须在线,否则返回null)
name
- 被查找玩家的名字@Deprecated Player getPlayerExact(java.lang.String name)
getPlayer(UUID)
用玩家名查找无法保证唯一性原文:Gets the player with the exact given name, case insensitive.
name
- 被查找玩家的准确名字@Deprecated java.util.List<Player> matchPlayer(java.lang.String name)
getPlayer(UUID)
用玩家名查找无法保证唯一性原文:Attempts to match any players with the given name, and returns a list of all possibly matches.
该list未排序,如果准确匹配到某个玩家则该List仅包含该玩家
原文:This list is not sorted in any particular order. If an exact match is found, the returned list will only contain a single result.
name
- 匹配玩家名Player getPlayer(java.util.UUID id)
原文:Gets the player with the given UUID.
id
- 用于检索玩家的UUIDPluginManager getPluginManager()
原文:Gets the plugin manager for interfacing with plugins.
BukkitScheduler getScheduler()
原文:Gets the scheduler for managing scheduled events.
ServicesManager getServicesManager()
原文:Gets a services manager.
java.util.List<World> getWorlds()
原文:Gets a list of all worlds on this server.
World createWorld(WorldCreator creator)
原文:Creates or loads a world with the given name using the specified options.
如果该World已经被加载,它相当于返回getWorld(creator.name())
原文:If the world is already loaded, it will just return the equivalent of getWorld(creator.name()).
creator
- 世界生成器boolean unloadWorld(java.lang.String name, boolean save)
原文:Unloads a world with the given name.
name
- 需要被卸载的世界的名字save
- 是否在卸载World前保存区块数据boolean unloadWorld(World world, boolean save)
原文:Unloads the given world.
world
- 被卸载的World实例save
- 是否在卸载World前保存区块数据World getWorld(java.lang.String name)
原文:Gets the world with the given name.
name
- 被获取世界的nameWorld getWorld(java.util.UUID uid)
原文:Gets the world from the given Unique ID.
uid
- 被获取的World的UUID@Deprecated MapView getMap(short id)
原文:Gets the map from the given item ID.
id
- 需要被获取的Map的idMapView createMap(World world)
Create a new map with an automatically assigned ID.
world
- 该Map所属的Worldvoid reload()
原文:Reloads the server, refreshing settings and plugin information.
void reloadData()
原文:Reload only the Minecraft data for the server. This includes custom advancements and loot tables.
java.util.logging.Logger getLogger()
原文:Returns the primary logger associated with this server instance.
PluginCommand getPluginCommand(java.lang.String name)
PluginCommand
通过给定的name或者别称
原文:Gets a PluginCommand
with the given name or alias.
name
- 命令名void savePlayers()
原文:Writes loaded players to disk.
boolean dispatchCommand(CommandSender sender, java.lang.String commandLine) throws CommandException
原文:Dispatches a command on this server, and executes it if found.
sender
- 执行该命令的对象commandLine
- sender执行的命令,由命令和参数组成. 示例: test abc
123
CommandException
- 抛出执行期间出现的未捕获的异常boolean addRecipe(Recipe recipe)
原文:Adds a recipe to the crafting manager.
recipe
- 被添加的配方java.util.List<Recipe> getRecipesFor(ItemStack result)
原文:Get a list of all recipes for a given item. The stack size is ignored in comparisons. If the durability is -1, it will match any data value.
result
- 被获取配方的ItemStackjava.util.Iterator<Recipe> recipeIterator()
原文:Get an iterator through the list of crafting recipes.
void clearRecipes()
原文:Clears the list of crafting recipes.
void resetRecipes()
原文:Resets the list of crafting recipes to the default.
java.util.Map<java.lang.String,java.lang.String[]> getCommandAliases()
原文:Gets a list of command aliases defined in the server properties.
int getSpawnRadius()
原文:Gets the radius, in blocks, around each worlds spawn point to protect.
void setSpawnRadius(int value)
原文:Sets the radius, in blocks, around each worlds spawn point to protect.
value
- 新的半径(若没有则设置0)boolean getOnlineMode()
原文:Gets whether the Server is in online mode or not.
boolean getAllowFlight()
原文:Gets whether this server allows flying or not.
boolean isHardcore()
原文:Gets whether the server is in hardcore mode or not.
void shutdown()
原文:Shutdowns the server, stopping everything.
int broadcast(java.lang.String message, java.lang.String permission)
原文:Broadcasts the specified message to every user with the given permission name.
message
- 需要公告的信息permission
- 需要的权限permissibles
@Deprecated OfflinePlayer getOfflinePlayer(java.lang.String name)
原文:Gets the player by the given name, regardless if they are offline or online.
该方法将会阻塞式调用一个网络请求用于获取给定name的UUID
原文:This method may involve a blocking web request to get the UUID for the given name.
对于该方法而言所有玩家都是存在的,即使玩家从未登录过服务器也会返回一个OfflinePlayer实例
原文:This will return an object even if the player does not exist. To this method, all players will exist.
name
- 玩家的namegetOfflinePlayer(java.util.UUID)
OfflinePlayer getOfflinePlayer(java.util.UUID id)
原文:Gets the player by the given UUID, regardless if they are offline or online.
对于该方法而言所有玩家都是存在的,即使玩家从未登录过服务器也会返回一个OfflinePlayer实例
原文:This will return an object even if the player does not exist. To this method, all players will exist.
id
- 玩家的UUIDjava.util.Set<java.lang.String> getIPBans()
原文:Gets a set containing all current IPs that are banned.
void banIP(java.lang.String address)
原文:Bans the specified address from the server.
address
- 禁止登陆的IP地址void unbanIP(java.lang.String address)
原文:Unbans the specified address from the server.
address
- 解除禁止登陆的IP地址java.util.Set<OfflinePlayer> getBannedPlayers()
原文:Gets a set containing all banned players.
BanList getBanList(BanList.Type type)
原文:Gets a ban list for the supplied type.
ban玩家name将不会受到支持,ban UUID更好
原文:Bans by name are no longer supported and this method will return null when trying to request them. The replacement is bans by UUID.
type
- 需要获取的BanList的类型java.util.Set<OfflinePlayer> getOperators()
原文:Gets a set containing all player operators.
GameMode getDefaultGameMode()
void setDefaultGameMode(GameMode mode)
mode
- 新的游戏模式ConsoleCommandSender getConsoleSender()
ConsoleCommandSender
将被作为服务器的标准输入(译注:该方法用于获取控制台)java.io.File getWorldContainer()
World
的文件夹的File实例.OfflinePlayer[] getOfflinePlayers()
原文:Gets every player that has ever played on this server.
Messenger getMessenger()
HelpMap getHelpMap()
Inventory createInventory(InventoryHolder owner, InventoryType type)
InventoryType.CHEST
,那么这个物品栏
的大小为27格(即0-26的slot可用),每个物品栏类型拥有其默认的大小
原文:Creates an empty inventory of the specified type. If the type is InventoryType.CHEST
, the new inventory has a size of 27; otherwise the
new inventory has the normal size for its type.
owner
- 该物品栏的拥有者,为null则表明无拥有者type
- 被创建的Inventory的类型Inventory createInventory(InventoryHolder owner, InventoryType type, java.lang.String title)
InventoryType.CHEST
,那么这个物品栏
的大小为27格(即0-26的slot可用),每个物品栏类型拥有其默认的大小
原文:Creates an empty inventory with the specified type and title. If the type
is InventoryType.CHEST
, the new inventory has a size of 27;
otherwise the new inventory has the normal size for its type.
注意:某些Inventory不支持标题,这些不支持标题的Inventory将不会在客户端渲染标题(即设置标题对这类Inventory无效)
原文:It should be noted that some inventory types do not support titles and may not render with said titles on the Minecraft client.
owner
- 该物品栏的拥有者,为null则表明无拥有者type
- 被创建的Inventory的类型title
- 被创建的Inventory的标题Inventory createInventory(InventoryHolder owner, int size) throws java.lang.IllegalArgumentException
InventoryType.CHEST
创建一个给定大小的Inventory
原文:Creates an empty inventory of type InventoryType.CHEST
with the
specified size.
owner
- 该物品栏的拥有者,为null则表明无拥有者size
- 被创建的Inventory的大小,该值应为9的倍数java.lang.IllegalArgumentException
- 如果size不为9的倍数Inventory createInventory(InventoryHolder owner, int size, java.lang.String title) throws java.lang.IllegalArgumentException
InventoryType.CHEST
来创建一个空的物品栏
原文:Creates an empty inventory of type InventoryType.CHEST
with the
specified size and title.
owner
- 该物品栏的拥有者,为null则表明无拥有者size
- 被创建的Inventory的大小,该值应为9的倍数title
- 被创建的Inventory的标题java.lang.IllegalArgumentException
- 如果size不为9的倍数Merchant createMerchant(java.lang.String title)
title
- the title of the corresponding merchant inventory, displayed
when the merchant inventory is viewedint getMonsterSpawnLimit()
原文:Gets user-specified limit for number of monsters that can spawn in a chunk.
int getAnimalSpawnLimit()
原文:Gets user-specified limit for number of animals that can spawn in a chunk.
int getWaterAnimalSpawnLimit()
原文:Gets user-specified limit for number of water animals that can spawn in a chunk.
int getAmbientSpawnLimit()
boolean isPrimaryThread()
原文:Checks the current thread against the expected primary thread for the server.
注意: 该方法不应该用于检查当前同步状态,当前线程为主线程表明它确实为同步,但是不能排除其他原因.
java.lang.String getMotd()
原文:Gets the message that is displayed on the server list.
java.lang.String getShutdownMessage()
原文:Gets the default message that is displayed when the server is stopped.
Warning.WarningState getWarningState()
原文:Gets the current warning state for the server.
ItemFactory getItemFactory()
ItemFactory
ScoreboardManager getScoreboardManager()
原文:Gets the instance of the scoreboard manager.
该实例在至少有一个世界被加载后才会创建
原文:This will only exist after the first world has loaded.
CachedServerIcon getServerIcon()
原文:Gets an instance of the server's default server-icon.
CachedServerIcon loadServerIcon(java.io.File file) throws java.lang.IllegalArgumentException, java.lang.Exception
原文:Loads an image from a file, and returns a cached image for the specific server-icon.
大小和类型必须在允许范围内,否则将会抛出Exception
.
原文:Size and type are implementation defined. An incompatible file is
guaranteed to throw an implementation-defined Exception
.
file
- 需要被加载的文件ServerListPingEvent.setServerIcon(CachedServerIcon)
java.lang.IllegalArgumentException
- 如果图片为nulljava.lang.Exception
- 如果图片规格不适用作为服务器图标CachedServerIcon loadServerIcon(java.awt.image.BufferedImage image) throws java.lang.IllegalArgumentException, java.lang.Exception
原文:Creates a cached server-icon for the specific image.
大小和类型必须在允许范围内,否则将会抛出Exception
.
原文:Size and type are implementation defined. An incompatible file is
guaranteed to throw an implementation-defined Exception
.
image
- 用于缓存的图片ServerListPingEvent.setServerIcon(CachedServerIcon)
java.lang.IllegalArgumentException
- 如果图片为nulljava.lang.Exception
- 如果图片规格不适用作为服务器图标void setIdleTimeout(int threshold)
原文:Set the idle kick timeout. Any players idle for the specified amount of time will be automatically kicked.
值为0时将不会踢出玩家
threshold
- 闲置超时的分钟数int getIdleTimeout()
原文:Gets the idle kick timeout.
ChunkGenerator.ChunkData createChunkData(World world)
原文:
Create a ChunkData for use in a generator.
See ChunkGenerator.generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)
world
- ChunkData对应的世界BossBar createBossBar(java.lang.String title, BarColor color, BarStyle style, BarFlag... flags)
原文: Creates a boss bar instance to display to players. The progress defaults to 1.0
title
- 血量条的标题color
- 血量条的颜色style
- 血量条的样式flags
- 创建的Boss血量条实例Entity getEntity(java.util.UUID uuid)
原文:Gets an entity on the server by its UUID
uuid
- 实体的UUIDAdvancement getAdvancement(NamespacedKey key)
key
- unique advancement keyjava.util.Iterator<Advancement> advancementIterator()
@Deprecated UnsafeValues getUnsafe()
UnsafeValues