接口的使用
org.bukkit.plugin.Plugin
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
与处理玩家输入的非聊天消息(即命令)相关的类.
致力于简化玩家与插件的直接通信的类(玩家与插件的对话,典型的场景比如操作的确认、提供插件所需数据).
为在
世界
内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.用于处理触发代码的执行的类.
与服务器程序状态变化有关的
事件
.用于提供在每种Minecraft概念上的插件指定数据的数据层.
用于提供玩家二态属性的类(推测二态为是管理员与不是管理员两种状态).
专门用于在运行时加载软件模组(插件)的类.
用Java编写的处理
插件
的类.用于设定插件至客户端的消息传输协议的类.
用于使
插件
以指定时间间隔运行代码的类,包括线程安全.-
org.bukkit中Plugin的使用
修饰符和类型方法说明Chunk.getPluginChunkTickets()
Retrieves a collection specifying which plugins have tickets for this chunk.World.getPluginChunkTickets()
Returns a map of which plugins have tickets for what chunks.World.getPluginChunkTickets
(int x, int z) Retrieves a collection specifying which plugins have tickets for the specified chunk.修饰符和类型方法说明boolean
Chunk.addPluginChunkTicket
(@NotNull Plugin plugin) Adds a plugin ticket for this chunk, loading this chunk if it is not already loaded.boolean
World.addPluginChunkTicket
(int x, int z, @NotNull Plugin plugin) Adds a plugin ticket for the specified chunk, loading the chunk if it is not already loaded.static @Nullable NamespacedKey
NamespacedKey.fromString
(@NotNull String string, @Nullable Plugin defaultNamespace) 根据提供的字符串获取 NamespacedKey 对象, 若字符串未指定命名空间名, 将使用参数给定的默认命名空间.boolean
Chunk.removePluginChunkTicket
(@NotNull Plugin plugin) Removes the specified plugin's ticket for this chunkboolean
World.removePluginChunkTicket
(int x, int z, @NotNull Plugin plugin) Removes the specified plugin's ticket for the specified chunkvoid
World.removePluginChunkTickets
(@NotNull Plugin plugin) Removes all plugin tickets for the specified plugin -
org.bukkit.command中Plugin的使用
-
org.bukkit.conversations中Plugin的使用
修饰符和类型字段说明protected Plugin
ConversationFactory.plugin
protected Plugin
InactivityConversationCanceller.plugin
protected Plugin
PluginNameConversationPrefix.plugin
限定符构造器说明Conversation
(@Nullable Plugin plugin, @NotNull Conversable forWhom, @Nullable Prompt firstPrompt) Initializes a new Conversation.Conversation
(@Nullable Plugin plugin, @NotNull Conversable forWhom, @Nullable Prompt firstPrompt, @NotNull Map<Object, Object> initialSessionData) Initializes a new Conversation.ConversationContext
(@Nullable Plugin plugin, @NotNull Conversable forWhom, @NotNull Map<Object, Object> initialSessionData) ConversationFactory
(@NotNull Plugin plugin) Constructs a ConversationFactory.InactivityConversationCanceller
(@NotNull Plugin plugin, int timeoutSeconds) Creates an InactivityConversationCanceller.PlayerNamePrompt
(@NotNull Plugin plugin) PluginNameConversationPrefix
(@NotNull Plugin plugin, @NotNull String separator, @NotNull ChatColor prefixColor) -
org.bukkit.entity中Plugin的使用
修饰符和类型方法说明void
Player.hideEntity
(@NotNull Plugin plugin, @NotNull Entity entity) 从视觉上隐藏一个实体.void
Player.hidePlayer
(@NotNull Plugin plugin, @NotNull Player player) 让该玩家看不见某玩家.void
Player.showEntity
(@NotNull Plugin plugin, @NotNull Entity entity) Allows this player to see an entity that was previously hidden.void
Player.showPlayer
(@NotNull Plugin plugin, @NotNull Player player) 让该玩家能看到之前被隐藏的玩家. -
org.bukkit.event中Plugin的使用
修饰符和类型方法说明static @NotNull ArrayList<RegisteredListener>
HandlerList.getRegisteredListeners
(@NotNull Plugin plugin) 获取与这个处理器列表相关的指定插件注册的监听器.void
HandlerList.unregister
(@NotNull Plugin plugin) 移除一个插件中指定的监听器.static void
HandlerList.unregisterAll
(@NotNull Plugin plugin) 从所有处理器列表中注销指定插件的所有监听器. -
org.bukkit.event.server中Plugin的使用
限定符构造器说明PluginDisableEvent
(@NotNull Plugin plugin) PluginEnableEvent
(@NotNull Plugin plugin) PluginEvent
(@NotNull Plugin plugin) -
org.bukkit.metadata中Plugin的使用
修饰符和类型方法说明MetadataValue.getOwningPlugin()
Returns thePlugin
that created this metadata item.MetadataValueAdapter.getOwningPlugin()
修饰符和类型方法说明void
MetadataStore.invalidateAll
(@NotNull Plugin owningPlugin) Invalidates all metadata in the metadata store that originates from the given plugin.void
MetadataStoreBase.invalidateAll
(@NotNull Plugin owningPlugin) Invalidates all metadata in the metadata store that originates from the given plugin.void
Metadatable.removeMetadata
(@NotNull String metadataKey, @NotNull Plugin owningPlugin) Removes the given metadata value from the implementing object's metadata store.void
Removes a metadata item owned by a plugin from a subject.void
MetadataStoreBase.removeMetadata
(T subject, @NotNull String metadataKey, @NotNull Plugin owningPlugin) Removes a metadata item owned by a plugin from a subject.限定符构造器说明FixedMetadataValue
(@NotNull Plugin owningPlugin, @Nullable Object value) Initializes a FixedMetadataValue with an Objectprotected
LazyMetadataValue
(@NotNull Plugin owningPlugin) Protected special constructor used by FixedMetadataValue to bypass standard setup.Initialized a LazyMetadataValue object with the default CACHE_AFTER_FIRST_EVAL cache strategy.LazyMetadataValue
(@NotNull Plugin owningPlugin, @NotNull LazyMetadataValue.CacheStrategy cacheStrategy, @NotNull Callable<Object> lazyValue) Initializes a LazyMetadataValue object with a specific cache strategy.protected
MetadataValueAdapter
(@NotNull Plugin owningPlugin) -
org.bukkit.permissions中Plugin的使用
修饰符和类型方法说明Permissible.addAttachment
(@NotNull Plugin plugin) Adds a new emptyPermissionAttachment
to this objectPermissible.addAttachment
(@NotNull Plugin plugin, int ticks) Temporarily adds a new emptyPermissionAttachment
to this objectPermissible.addAttachment
(@NotNull Plugin plugin, @NotNull String name, boolean value) Adds a newPermissionAttachment
with a single permission by name and valuePermissible.addAttachment
(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) Temporarily adds a newPermissionAttachment
with a single permission by name and valuePermissibleBase.addAttachment
(@NotNull Plugin plugin) PermissibleBase.addAttachment
(@NotNull Plugin plugin, int ticks) PermissibleBase.addAttachment
(@NotNull Plugin plugin, @NotNull String name, boolean value) PermissibleBase.addAttachment
(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) -
org.bukkit.plugin中Plugin的使用
修饰符和类型方法说明检测指定插件是否已加载并在合适时返回其对象.RegisteredListener.getPlugin()
Gets the plugin for this registrationRegisteredServiceProvider.getPlugin()
检测指定插件是否已加载并在合适时返回其对象.PluginManager.getPlugins()
获取所有已载入的插件对象.SimplePluginManager.getPlugins()
PluginLoader.loadPlugin
(@NotNull File file) 加载指定插件文件.PluginManager.loadPlugin
(@NotNull File file) 加载某个文件为插件.SimplePluginManager.loadPlugin
(@NotNull File file) 加载某个文件为插件.PluginManager.loadPlugins
(@NotNull File directory) 载入指定目录内的插件.PluginManager.loadPlugins
(@NotNull File[] files) Loads the plugins in the list of the filesSimplePluginManager.loadPlugins
(@NotNull File directory) 载入指定目录内的插件.SimplePluginManager.loadPlugins
(@NotNull File[] files) Loads the plugins in the list of the files修饰符和类型方法说明PluginLoader.createRegisteredListeners
(@NotNull Listener listener, @NotNull Plugin plugin) 创建并返回给定的监听器中为对应事件类注册过的监听器.void
PluginLoader.disablePlugin
(@NotNull Plugin plugin) 停用指定的插件.void
PluginManager.disablePlugin
(@NotNull Plugin plugin) 停用指定的插件.void
SimplePluginManager.disablePlugin
(@NotNull Plugin plugin) void
PluginLoader.enablePlugin
(@NotNull Plugin plugin) 启用指定的插件.void
PluginManager.enablePlugin
(@NotNull Plugin plugin) 启用指定插件.void
SimplePluginManager.enablePlugin
(@NotNull Plugin plugin) ServicesManager.getRegistrations
(@NotNull Plugin plugin) Get registrations of providers for a plugin.SimpleServicesManager.getRegistrations
(@NotNull Plugin plugin) Get registrations of providers for a plugin.boolean
PluginManager.isPluginEnabled
(@Nullable Plugin plugin) 检查指定插件是否启用.boolean
SimplePluginManager.isPluginEnabled
(@Nullable Plugin plugin) 检查指定插件是否启用.<T> void
ServicesManager.register
(@NotNull Class<T> service, T provider, @NotNull Plugin plugin, @NotNull ServicePriority priority) Register a provider of a service.<T> void
SimpleServicesManager.register
(@NotNull Class<T> service, T provider, @NotNull Plugin plugin, @NotNull ServicePriority priority) Register a provider of a service.void
PluginManager.registerEvent
(@NotNull Class<? extends Event> event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin) 将指定的执行器注册至指定的事件类.void
PluginManager.registerEvent
(@NotNull Class<? extends Event> event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin, boolean ignoreCancelled) 将指定的执行器注册至指定的事件类.void
SimplePluginManager.registerEvent
(@NotNull Class<? extends Event> event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin) void
SimplePluginManager.registerEvent
(@NotNull Class<? extends Event> event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin, boolean ignoreCancelled) 将指定的执行器注册至指定的事件类.void
PluginManager.registerEvents
(@NotNull Listener listener, @NotNull Plugin plugin) 注册在指定监听器类中的所有事件.void
SimplePluginManager.registerEvents
(@NotNull Listener listener, @NotNull Plugin plugin) void
ServicesManager.unregisterAll
(@NotNull Plugin plugin) Unregister all the providers registered by a particular plugin.void
SimpleServicesManager.unregisterAll
(@NotNull Plugin plugin) Unregister all the providers registered by a particular plugin.限定符构造器说明PluginLogger
(@NotNull Plugin context) 以指定插件创建一个新的 PluginLogger, 其插件名从插件对象中提取.RegisteredListener
(@NotNull Listener listener, @NotNull EventExecutor executor, @NotNull EventPriority priority, @NotNull Plugin plugin, boolean ignoreCancelled) RegisteredServiceProvider
(@NotNull Class<T> service, T provider, @NotNull ServicePriority priority, @NotNull Plugin plugin) TimedRegisteredListener
(@NotNull Listener pluginListener, @NotNull EventExecutor eventExecutor, @NotNull EventPriority eventPriority, @NotNull Plugin registeredPlugin, boolean listenCancelled) -
org.bukkit.plugin.java中Plugin的使用
修饰符和类型方法说明JavaPluginLoader.createRegisteredListeners
(@NotNull Listener listener, @NotNull Plugin plugin) void
JavaPluginLoader.disablePlugin
(@NotNull Plugin plugin) void
JavaPluginLoader.enablePlugin
(@NotNull Plugin plugin) -
org.bukkit.plugin.messaging中Plugin的使用
修饰符和类型方法说明Messenger.getIncomingChannelRegistrations
(@NotNull Plugin plugin) 获取一个包含了指定插件拥有的所有接收的插件通道的注册的set集合.Messenger.getIncomingChannelRegistrations
(@NotNull Plugin plugin, @NotNull String channel) 获取一个包含了指定插件在请求的通道上的所有接收的插件通道的注册的set集合.StandardMessenger.getIncomingChannelRegistrations
(@NotNull Plugin plugin) StandardMessenger.getIncomingChannelRegistrations
(@NotNull Plugin plugin, @NotNull String channel) Messenger.getIncomingChannels
(@NotNull Plugin plugin) 获取一个包含了指定插件注册的所有接收的插件通道的set集合.StandardMessenger.getIncomingChannels
(@NotNull Plugin plugin) Messenger.getOutgoingChannels
(@NotNull Plugin plugin) 获取一个包含了指定插件注册的全部向外发送的插件通道的set集合.StandardMessenger.getOutgoingChannels
(@NotNull Plugin plugin) boolean
Messenger.isIncomingChannelRegistered
(@NotNull Plugin plugin, @NotNull String channel) 检测指定插件注册的传入的消息是否通过了请求的通道.boolean
StandardMessenger.isIncomingChannelRegistered
(@NotNull Plugin plugin, @NotNull String channel) boolean
Messenger.isOutgoingChannelRegistered
(@NotNull Plugin plugin, @NotNull String channel) 检测指定插件注册的发送的消息是否通过了请求的通道.boolean
StandardMessenger.isOutgoingChannelRegistered
(@NotNull Plugin plugin, @NotNull String channel) Messenger.registerIncomingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) 注册指定的监听指定的接收的插件通道的插件,允许它在任何插件消息上做动作.StandardMessenger.registerIncomingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) void
Messenger.registerOutgoingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel) 注册指定插件所请求的发送插件通道,允许它通过这个通道向任何客户端发送消息.void
StandardMessenger.registerOutgoingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel) void
PluginMessageRecipient.sendPluginMessage
(@NotNull Plugin source, @NotNull String channel, @org.jetbrains.annotations.NotNull byte[] message) 在指定的通道向接收者发送插件消息(Plugin Message).void
Messenger.unregisterIncomingPluginChannel
(@NotNull Plugin plugin) 注销指定插件在所有监听器上监听的插件通道.void
Messenger.unregisterIncomingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel) 注销指定插件请求的监听的接收的插件通道,不再允许它在任何插件消息上做动作.void
Messenger.unregisterIncomingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) 注销指定插件请求的监听接收的插件通道的监听器,不再允许它在任何插件消息上做任何动作.void
StandardMessenger.unregisterIncomingPluginChannel
(@NotNull Plugin plugin) void
StandardMessenger.unregisterIncomingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel) void
StandardMessenger.unregisterIncomingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) void
Messenger.unregisterOutgoingPluginChannel
(@NotNull Plugin plugin) 注销指定插件的所有向外发送插件通道,不再允许它发送任何插件消息.void
Messenger.unregisterOutgoingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel) 注销指定插件请求的插件发送通道,不再允许它通过这个通道发送消息到任何客户端.void
StandardMessenger.unregisterOutgoingPluginChannel
(@NotNull Plugin plugin) void
StandardMessenger.unregisterOutgoingPluginChannel
(@NotNull Plugin plugin, @NotNull String channel) static void
StandardMessenger.validatePluginMessage
(@NotNull Messenger messenger, @NotNull Plugin source, @NotNull String channel, @org.jetbrains.annotations.NotNull byte[] message) Validates the input of a Plugin Message, ensuring the arguments are all valid.限定符构造器说明PluginMessageListenerRegistration
(@NotNull Messenger messenger, @NotNull Plugin plugin, @NotNull String channel, @NotNull PluginMessageListener listener) -
org.bukkit.scheduler中Plugin的使用
修饰符和类型方法说明BukkitScheduler.callSyncMethod
(@NotNull Plugin plugin, @NotNull Callable<T> task) 调用主线程的一个方法并返回Future对象.这个任务将被服务器主线程执行.void
BukkitScheduler.cancelTasks
(@NotNull Plugin plugin) 取消执行特定的插件所请求的所有任务.让Bukkit任务调度器在下一个tick运行任务.返回下一个tick服务器将运行的任务(即于下一tick执行指定任务).void
返回下一个tick服务器将运行的任务(即于下一tick执行指定任务).BukkitScheduler.runTask
(@NotNull Plugin plugin, @NotNull BukkitRunnable task) 已过时。BukkitRunnable.runTaskAsynchronously
(@NotNull Plugin plugin) 在Bukkit任务调度器异步运行这个任务.BukkitScheduler.runTaskAsynchronously
(@NotNull Plugin plugin, @NotNull Runnable task) 异步任务不应访问Bukkit里的任何API. 应着重保证异步任务的线程安全.void
BukkitScheduler.runTaskAsynchronously
(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task) 异步任务不应访问Bukkit里的任何API. 应着重保证异步任务的线程安全.BukkitScheduler.runTaskAsynchronously
(@NotNull Plugin plugin, @NotNull BukkitRunnable task) BukkitRunnable.runTaskLater
(@NotNull Plugin plugin, long delay) 在指定tick后执行该任务.BukkitScheduler.runTaskLater
(@NotNull Plugin plugin, @NotNull Runnable task, long delay) 返回指定tick过后运行的任务(即延迟执行).void
BukkitScheduler.runTaskLater
(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay) 返回指定tick过后运行的任务(即延迟执行).BukkitScheduler.runTaskLater
(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay) BukkitRunnable.runTaskLaterAsynchronously
(@NotNull Plugin plugin, long delay) 让Bukkit任务调度器在指定的tick后异步执行这个任务.BukkitScheduler.runTaskLaterAsynchronously
(@NotNull Plugin plugin, @NotNull Runnable task, long delay) 异步任务不应访问Bukkit里的任何API. 应着重保证异步任务的线程安全.void
BukkitScheduler.runTaskLaterAsynchronously
(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay) 异步任务不应访问Bukkit里的任何API. 应着重保证异步任务的线程安全.BukkitScheduler.runTaskLaterAsynchronously
(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay) BukkitRunnable.runTaskTimer
(@NotNull Plugin plugin, long delay, long period) 在指定时间后开始以指定的间隔不断执行任务.BukkitScheduler.runTaskTimer
(@NotNull Plugin plugin, @NotNull Runnable task, long delay, long period) 返回一个任务.此任务将在指定tick数值后运行.任务将重复运行直至取消.void
BukkitScheduler.runTaskTimer
(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay, long period) 返回一个任务.此任务将在指定tick数值后运行.任务将重复运行直至取消.BukkitScheduler.runTaskTimer
(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay, long period) BukkitRunnable.runTaskTimerAsynchronously
(@NotNull Plugin plugin, long delay, long period) 让Bukkit任务调度器在指定的tick后开始异步的以指定的间隔不断执行任务.BukkitScheduler.runTaskTimerAsynchronously
(@NotNull Plugin plugin, @NotNull Runnable task, long delay, long period) 异步任务不应访问Bukkit里的任何API. 应着重保证异步任务的线程安全.void
BukkitScheduler.runTaskTimerAsynchronously
(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay, long period) 异步任务不应访问Bukkit里的任何API. 应着重保证异步任务的线程安全.BukkitScheduler.runTaskTimerAsynchronously
(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay, long period) int
BukkitScheduler.scheduleAsyncDelayedTask
(@NotNull Plugin plugin, @NotNull Runnable task) 已过时。这个名称具有误导性.因为它没有执行“同步”任务.而是“异步”任务int
BukkitScheduler.scheduleAsyncDelayedTask
(@NotNull Plugin plugin, @NotNull Runnable task, long delay) 已过时。这个名称具有误导性.因为它没有执行“同步”任务.而是“异步”任务int
BukkitScheduler.scheduleAsyncRepeatingTask
(@NotNull Plugin plugin, @NotNull Runnable task, long delay, long period) 已过时。这个名称具有误导性.因为它没有执行“同步”任务.而是“异步”任务int
BukkitScheduler.scheduleSyncDelayedTask
(@NotNull Plugin plugin, @NotNull Runnable task) 在下一tick执行一次任务.int
BukkitScheduler.scheduleSyncDelayedTask
(@NotNull Plugin plugin, @NotNull Runnable task, long delay) 在指定延迟后执行一次任务.int
BukkitScheduler.scheduleSyncDelayedTask
(@NotNull Plugin plugin, @NotNull BukkitRunnable task) 已过时。int
BukkitScheduler.scheduleSyncDelayedTask
(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay) int
BukkitScheduler.scheduleSyncRepeatingTask
(@NotNull Plugin plugin, @NotNull Runnable task, long delay, long period) 在指定延迟后开始以指定间隔重复执行任务.int
BukkitScheduler.scheduleSyncRepeatingTask
(@NotNull Plugin plugin, @NotNull BukkitRunnable task, long delay, long period)
BukkitRunnable.runTask(Plugin)