mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-11 22:16:57 +00:00
fix legacy mode event registration
This commit is contained in:
@@ -28,15 +28,15 @@ public class CommandWhitelist extends JavaPlugin {
|
|||||||
|
|
||||||
Plugin protocollib = getServer().getPluginManager().getPlugin("ProtocolLib");
|
Plugin protocollib = getServer().getPluginManager().getPlugin("ProtocolLib");
|
||||||
|
|
||||||
getServer().getPluginManager().registerEvents(new PlayerCommandSendListener(), this);
|
|
||||||
if (!isLegacy) {
|
if (!isLegacy) {
|
||||||
if (!getConfigCache().isUseProtocolLib() || protocollib == null || !protocollib.isEnabled()) {
|
if (!getConfigCache().isUseProtocolLib() || protocollib == null || !protocollib.isEnabled()) {
|
||||||
getServer().getPluginManager().registerEvents(new PlayerCommandPreProcessListener(), this);
|
getServer().getPluginManager().registerEvents(new PlayerCommandPreProcessListener(), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new PlayerCommandSendListener(), this);
|
||||||
} else {
|
} else {
|
||||||
PacketCommandSendListener.protocol(this);
|
PacketCommandSendListener.protocol(this);
|
||||||
getLogger().info(ChatColor.AQUA+"Using ProtocolLib for command filter!");
|
getLogger().info(ChatColor.AQUA+"Using ProtocolLib for command filter!");
|
||||||
}
|
}
|
||||||
|
getServer().getPluginManager().registerEvents(new TabCompleteBlockerListener(), this);
|
||||||
} else {
|
} else {
|
||||||
getLogger().info(ChatColor.AQUA+"Running in legacy mode...");
|
getLogger().info(ChatColor.AQUA+"Running in legacy mode...");
|
||||||
if (protocollib != null) {
|
if (protocollib != null) {
|
||||||
@@ -46,8 +46,6 @@ public class CommandWhitelist extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getServer().getPluginManager().registerEvents(new TabCompleteBlockerListener(), this);
|
|
||||||
|
|
||||||
getCommand("commandwhitelist").setExecutor(new MainCommand());
|
getCommand("commandwhitelist").setExecutor(new MainCommand());
|
||||||
getCommand("commandwhitelist").setTabCompleter(new MainCommand());
|
getCommand("commandwhitelist").setTabCompleter(new MainCommand());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user