public abstract class EasyPlugin
extends org.bukkit.plugin.java.JavaPlugin
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
initialized |
protected @NotNull EasyPluginMessageProvider |
messageProvider |
protected SchedulerUtils |
scheduler |
限定符 | 构造器和说明 |
---|---|
|
EasyPlugin() |
|
EasyPlugin(@NotNull EasyPluginMessageProvider messageProvider) |
protected |
EasyPlugin(@NotNull EasyPluginMessageProvider messageProvider,
org.bukkit.plugin.java.JavaPluginLoader loader,
org.bukkit.plugin.PluginDescriptionFile descriptionFile,
java.io.File dataFolder,
java.io.File file) |
protected |
EasyPlugin(org.bukkit.plugin.java.JavaPluginLoader loader,
org.bukkit.plugin.PluginDescriptionFile descriptionFile,
java.io.File dataFolder,
java.io.File file) |
限定符和类型 | 方法和说明 |
---|---|
<T extends org.bukkit.event.Event> |
callAsync(T event)
在异步线程中唤起一个事件,并支持获取事件的结果。
|
<T extends org.bukkit.event.Event> |
callSync(T event)
在主线程唤起一个事件,并支持获取事件的结果。
|
void |
debug(java.lang.String... messages) |
void |
error(java.lang.String... messages) |
SchedulerUtils |
getScheduler() |
protected abstract boolean |
initialize() |
boolean |
isDebugging() |
protected void |
load() |
void |
log(java.lang.String... messages) |
void |
onDisable() |
void |
onEnable() |
void |
onLoad() |
void |
outputInfo()
重写以展示插件的相关信息,如插件横幅、下载地址等。
|
void |
print(@Nullable java.lang.String prefix,
java.lang.String... messages) |
void |
registerCommand(java.lang.String commandName,
@NotNull org.bukkit.command.CommandExecutor executor) |
void |
registerCommand(java.lang.String commandName,
@NotNull org.bukkit.command.CommandExecutor executor,
@Nullable org.bukkit.command.TabCompleter tabCompleter) |
void |
registerListener(org.bukkit.event.Listener... listeners) |
protected void |
setMessageProvider(@NotNull EasyPluginMessageProvider provider) |
protected void |
shutdown() |
<T> @NotNull java.util.concurrent.CompletableFuture<T> |
supplyAsync(@NotNull java.util.function.Supplier<T> action)
在异步线程中执行一个操作,并获取操作的结果。
|
<T> @NotNull java.util.concurrent.CompletableFuture<T> |
supplySync(@NotNull java.util.function.Supplier<T> action)
在主线程执行操作,并支持获取其结果。
|
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
@NotNull protected @NotNull EasyPluginMessageProvider messageProvider
protected SchedulerUtils scheduler
protected boolean initialized
public EasyPlugin()
public EasyPlugin(@NotNull @NotNull EasyPluginMessageProvider messageProvider)
protected EasyPlugin(org.bukkit.plugin.java.JavaPluginLoader loader, org.bukkit.plugin.PluginDescriptionFile descriptionFile, java.io.File dataFolder, java.io.File file)
protected EasyPlugin(@NotNull @NotNull EasyPluginMessageProvider messageProvider, org.bukkit.plugin.java.JavaPluginLoader loader, org.bukkit.plugin.PluginDescriptionFile descriptionFile, java.io.File dataFolder, java.io.File file)
public final void onLoad()
onLoad
在接口中 org.bukkit.plugin.Plugin
onLoad
在类中 org.bukkit.plugin.java.JavaPlugin
public final void onEnable()
onEnable
在接口中 org.bukkit.plugin.Plugin
onEnable
在类中 org.bukkit.plugin.java.JavaPlugin
public final void onDisable()
onDisable
在接口中 org.bukkit.plugin.Plugin
onDisable
在类中 org.bukkit.plugin.java.JavaPlugin
protected void load()
protected abstract boolean initialize()
protected void shutdown()
public void outputInfo()
public boolean isDebugging()
public SchedulerUtils getScheduler()
public void registerListener(@NotNull org.bukkit.event.Listener... listeners)
public void registerCommand(java.lang.String commandName, @NotNull @NotNull org.bukkit.command.CommandExecutor executor)
public void registerCommand(java.lang.String commandName, @NotNull @NotNull org.bukkit.command.CommandExecutor executor, @Nullable @Nullable org.bukkit.command.TabCompleter tabCompleter)
public void print(@Nullable @Nullable java.lang.String prefix, @Nullable java.lang.String... messages)
public void log(@Nullable java.lang.String... messages)
public void error(java.lang.String... messages)
public void debug(@Nullable java.lang.String... messages)
@NotNull public <T> @NotNull java.util.concurrent.CompletableFuture<T> supplySync(@NotNull @NotNull java.util.function.Supplier<T> action)
T
- 结果类型action
- 需要执行的内容@NotNull public <T> @NotNull java.util.concurrent.CompletableFuture<T> supplyAsync(@NotNull @NotNull java.util.function.Supplier<T> action)
T
- 事件类型action
- 需要执行的内容@NotNull public <T extends org.bukkit.event.Event> @NotNull java.util.concurrent.CompletableFuture<T> callSync(T event)
T
- 事件类型event
- 同步事件 (isAsync=false)@NotNull public <T extends org.bukkit.event.Event> @NotNull java.util.concurrent.CompletableFuture<T> callAsync(T event)
T
- 事件类型event
- 异步事件 (isAsync=true)protected void setMessageProvider(@NotNull @NotNull EasyPluginMessageProvider provider)
Copyright © 2024. All rights reserved.