mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-12-02 13:29:42 -05:00
Experimental
This commit is contained in:
1 parent
cc1fb33eff
commit
c38b3e03ca
3 files changed
+55
-2
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package de.rayzs.pat.plugin.command;
|
||||
|
||||
import de.rayzs.pat.utils.Storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandHandler {
|
||||
|
||||
private String groupName = null;
|
||||
private final List<CommandNode> executes, tabs;
|
||||
|
||||
/*
|
||||
Experimental for next update...
|
||||
*/
|
||||
|
||||
public CommandHandler() {
|
||||
this.executes = new ArrayList<>();
|
||||
this.tabs = new ArrayList<>();
|
||||
}
|
||||
|
||||
public CommandHandler(String groupName) {
|
||||
this.groupName = groupName;
|
||||
this.executes = new ArrayList<>();
|
||||
this.tabs = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package de.rayzs.pat.plugin.command;
|
||||
|
||||
public interface CommandNode {
|
||||
String name();
|
||||
default boolean equals(String target, boolean intensive) {
|
||||
target = target.toLowerCase();
|
||||
|
||||
String[] split;
|
||||
if(target.contains(" ")) {
|
||||
split = target.split(" ");
|
||||
if(split.length > 0) target = split[0];
|
||||
target = target.split(" ")[0];
|
||||
}
|
||||
|
||||
if(intensive && target.contains(":")) {
|
||||
split = target.split(":");
|
||||
if(split.length > 0)
|
||||
target = target.replaceFirst(split[0] + ":", "");
|
||||
}
|
||||
|
||||
return target.equals(name());
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,11 @@ import java.util.*;
|
||||
|
||||
public class Storage {
|
||||
|
||||
public static ConfigurationBuilder CONFIGURATION = Configurator.get("config"), STORAGE = Configurator.get("storage"),
|
||||
COMMANDS = Configurator.get("commands"),
|
||||
TOKEN = Configurator.get("token");
|
||||
|
||||
public static String CURRENT_VERSION_NAME = "", NEWEST_VERSION_NAME = "";
|
||||
public static ConfigurationBuilder CONFIGURATION = Configurator.get("config"), STORAGE = Configurator.get("storage"), TOKEN = Configurator.get("token");
|
||||
public static List<String> UNKNOWN_COMMAND, CANCEL_COMMANDS_MESSAGE, STATS, BLOCKED_COMMANDS_LIST, COMMAND_HELP, CUSTOM_SERVER_BRANDS, UPDATE_NOTIFICATION, CUSTOM_PLUGINS;
|
||||
public static List<UUID> NOTIFY_PLAYERS = new ArrayList<>();
|
||||
public static String TOKEN_KEY = UUID.randomUUID().toString(), BUNGEECORD_MESSAGE, NOTIFY_ALERT, NOTIFY_ENABLED, NOTIFY_DISABLED, COMMAND_UNKNOWN, NO_PERMISSIONS, RELOAD_LOADING, RELOAD_DONE,
|
||||
@@ -92,7 +95,7 @@ public class Storage {
|
||||
BUNGEECORD_MESSAGE = (String) CONFIGURATION.getOrSet("handle-through-proxy.message", BUNGEECORD_MESSAGE);
|
||||
USE_UNKNOWN_COMMAND = (boolean) CONFIGURATION.getOrSet("custom-unknown-command.enabled", USE_UNKNOWN_COMMAND);
|
||||
UNKNOWN_COMMAND = (ArrayList<String>) CONFIGURATION.getOrSet("custom-unknown-command.message", defaultUnknownCommandArray);
|
||||
|
||||
} else {
|
||||
USE_CUSTOM_PROTOCOL_PING = (boolean) CONFIGURATION.getOrSet("custom-protocol-ping.enabled", false);
|
||||
USE_ALWAYS_SHOW_CUSTOM_PROTOCOL_PING = (boolean) CONFIGURATION.getOrSet("custom-protocol-ping.show-always", true);
|
||||
CUSTOM_PROTOCOL_PING = (String) CONFIGURATION.getOrSet("custom-protocol-ping.protocol", "&f&lProAntiTab &7(&a%online%&7/&c%max%&7)");
|
||||
|
||||
Reference in new issue
Block a user