添加了玩家退出事件注册到服务器的代码

解决了玩家退出后插件不正常的问题
This commit is contained in:
张宇衡 2023-06-03 11:57:49 +08:00
parent 883bc3568e
commit f9394edefd
2 changed files with 2 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<groupId>site.deercloud</groupId> <groupId>site.deercloud</groupId>
<artifactId>LiteWorldEdit</artifactId> <artifactId>LiteWorldEdit</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>LiteWorldEdit</name> <name>LiteWorldEdit</name>

View File

@ -51,6 +51,7 @@ public final class LiteWorldEdit extends JavaPlugin {
} }
}.runTaskTimer(this, 0, 1); }.runTaskTimer(this, 0, 1);
Bukkit.getPluginManager().registerEvents(new Events(), this);
Objects.requireNonNull(Bukkit.getPluginCommand("LiteWorldEdit")).setExecutor(new Commands()); Objects.requireNonNull(Bukkit.getPluginCommand("LiteWorldEdit")).setExecutor(new Commands());
Objects.requireNonNull(Bukkit.getPluginCommand("LiteWorldEdit")).setTabCompleter(new Commands()); Objects.requireNonNull(Bukkit.getPluginCommand("LiteWorldEdit")).setTabCompleter(new Commands());