TCheckpoint
This commit is contained in:
parent
2845cc512f
commit
c5b686aeb5
55 changed files with 453 additions and 213 deletions
|
|
@ -1,23 +1,20 @@
|
|||
package org.gsdistance.grimmsServer.Data;
|
||||
|
||||
import org.gsdistance.grimmsServer.Config.ActiveConfig;
|
||||
import org.gsdistance.grimmsServer.Config.ConfigKey;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static org.gsdistance.grimmsServer.Config.ActiveConfig.getConfigValue;
|
||||
|
||||
public class ConfigRequirements {
|
||||
public static final Map<String, String> CommandRequirements = Map.ofEntries(
|
||||
Map.entry("logLeaderboard", "leaderboard"),
|
||||
Map.entry("sendMoney", "market"),
|
||||
Map.entry("makeItemLevelable", "leveling"),
|
||||
Map.entry("setPlayerStat", "stats"),
|
||||
Map.entry("logPlayerStats", "stats"),
|
||||
Map.entry("logSelfStats", "stats"),
|
||||
Map.entry("logWorldStats", "stats"),
|
||||
Map.entry("logEnchantmentCosts", "market"),
|
||||
Map.entry("logJobs", "job"),
|
||||
Map.entry("takeJob", "job"),
|
||||
Map.entry("logSelfTitles", "titles"),
|
||||
Map.entry("logPlayerTitles", "titles"),
|
||||
Map.entry("addTitle", "titles"),
|
||||
Map.entry("removeTitle", "titles"),
|
||||
Map.entry("executePlayer", "titles"),
|
||||
|
|
@ -31,19 +28,19 @@ public class ConfigRequirements {
|
|||
|
||||
public static boolean isCommandEnabled(String command) {
|
||||
return switch (CommandRequirements.getOrDefault(command, "default")) {
|
||||
case "market" -> ActiveConfig.module_Market;
|
||||
case "leaderboard" -> ActiveConfig.module_Leaderboard;
|
||||
case "job" -> ActiveConfig.module_Jobs;
|
||||
case "stats" -> ActiveConfig.module_Leveling;
|
||||
case "titles" -> ActiveConfig.module_Titles;
|
||||
case "chat" -> ActiveConfig.module_Chat;
|
||||
case "homes" -> ActiveConfig.module_Homes;
|
||||
case "utils" -> ActiveConfig.module_Utils;
|
||||
case "ranks" -> ActiveConfig.module_Ranks;
|
||||
case "factions" -> ActiveConfig.module_Factions;
|
||||
case "relics" -> ActiveConfig.module_Relics;
|
||||
case "events" -> ActiveConfig.module_Events;
|
||||
case "dimensions" -> ActiveConfig.module_Dimensions;
|
||||
case "market" -> getConfigValue(ConfigKey.MODULE_MARKET,Boolean.class);
|
||||
case "leaderboard" -> getConfigValue(ConfigKey.MODULE_LEADERBOARD, Boolean.class);
|
||||
case "job" -> getConfigValue(ConfigKey.MODULE_JOBS, Boolean.class);
|
||||
case "stats" -> getConfigValue(ConfigKey.MODULE_LEVELING, Boolean.class);
|
||||
case "titles" -> getConfigValue(ConfigKey.MODULE_TITLES, Boolean.class);
|
||||
case "chat" -> getConfigValue(ConfigKey.MODULE_CHAT, Boolean.class);
|
||||
case "homes" -> getConfigValue(ConfigKey.MODULE_HOMES, Boolean.class);
|
||||
case "utils" -> getConfigValue(ConfigKey.MODULE_UTILS, Boolean.class);
|
||||
case "ranks" -> getConfigValue(ConfigKey.MODULE_RANKS, Boolean.class);
|
||||
case "factions" -> getConfigValue(ConfigKey.MODULE_FACTIONS, Boolean.class);
|
||||
case "relics" -> getConfigValue(ConfigKey.MODULE_RELICS, Boolean.class);
|
||||
case "events" -> getConfigValue(ConfigKey.MODULE_EVENTS, Boolean.class);
|
||||
case "dimensions" -> getConfigValue(ConfigKey.MODULE_DIMENSIONS, Boolean.class);
|
||||
case "default" -> true; // Default commands are always enabled
|
||||
default -> true; // Unknown command category
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue