diff options
| author | sowgro <tpoke.ferrari@gmail.com> | 2024-06-10 01:05:22 -0400 | 
|---|---|---|
| committer | sowgro <tpoke.ferrari@gmail.com> | 2024-06-10 01:05:22 -0400 | 
| commit | a8f5a1457a3da4b99a982ab0e400f96c0d91c9f4 (patch) | |
| tree | 50df898fd1e6e50c0d8ae5f1fd0fc7b1f3599351 /src | |
| parent | 2aa28e390b8a9fa763baef30e204af78e1a28456 (diff) | |
| download | Tumble-a8f5a1457a3da4b99a982ab0e400f96c0d91c9f4.tar.gz Tumble-a8f5a1457a3da4b99a982ab0e400f96c0d91c9f4.tar.bz2 Tumble-a8f5a1457a3da4b99a982ab0e400f96c0d91c9f4.zip | |
Change command format
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/com/MylesAndMore/Tumble/Main.java | 12 | ||||
| -rw-r--r-- | src/main/java/com/MylesAndMore/Tumble/plugin/ConfigManager.java | 11 | ||||
| -rw-r--r-- | src/main/resources/plugin.yml | 24 | 
3 files changed, 24 insertions, 23 deletions
| diff --git a/src/main/java/com/MylesAndMore/Tumble/Main.java b/src/main/java/com/MylesAndMore/Tumble/Main.java index f3ea52e..8221973 100644 --- a/src/main/java/com/MylesAndMore/Tumble/Main.java +++ b/src/main/java/com/MylesAndMore/Tumble/Main.java @@ -17,12 +17,12 @@ public class Main extends JavaPlugin{      public void onEnable() {          plugin = this; -        Objects.requireNonNull(this.getCommand("reload")).setExecutor(new Reload()); -        Objects.requireNonNull(this.getCommand("config")).setExecutor(new Config()); -        Objects.requireNonNull(this.getCommand("forcestart")).setExecutor(new ForceStart()); -        Objects.requireNonNull(this.getCommand("join")).setExecutor(new Join()); -        Objects.requireNonNull(this.getCommand("leave")).setExecutor(new Leave()); -        Objects.requireNonNull(this.getCommand("forcestop")).setExecutor(new ForceStop()); +        Objects.requireNonNull(this.getCommand("tumble-reload")).setExecutor(new Reload()); +        Objects.requireNonNull(this.getCommand("tumble-config")).setExecutor(new Config()); +        Objects.requireNonNull(this.getCommand("tumble-forcestart")).setExecutor(new ForceStart()); +        Objects.requireNonNull(this.getCommand("tumble-join")).setExecutor(new Join()); +        Objects.requireNonNull(this.getCommand("tumble-leave")).setExecutor(new Leave()); +        Objects.requireNonNull(this.getCommand("tumble-forcestop")).setExecutor(new ForceStop());          new Metrics(this, 16940);          // TODO: change command format diff --git a/src/main/java/com/MylesAndMore/Tumble/plugin/ConfigManager.java b/src/main/java/com/MylesAndMore/Tumble/plugin/ConfigManager.java index 3207e1b..c0f6686 100644 --- a/src/main/java/com/MylesAndMore/Tumble/plugin/ConfigManager.java +++ b/src/main/java/com/MylesAndMore/Tumble/plugin/ConfigManager.java @@ -27,6 +27,7 @@ public class ConfigManager {       * Reads config file and populates values above       */      public static void readConfig() { +        plugin.reloadConfig();          FileConfiguration config = plugin.getConfig();          // arenas @@ -52,7 +53,7 @@ public class ConfigManager {              Result<Location>res = readWorld(config.getConfigurationSection("lobby-spawn"));              if (!res.success) {                  plugin.getLogger().warning("Failed to load lobby: "+res.error); -                plugin.getLogger().severe("Lobby world is required. Run '/tumble:config set lobbyWorld' ASAP"); +                plugin.getLogger().severe("Lobby world is required. Run '/tumble-config set lobbyWorld' ASAP");              }              lobby = res.value; @@ -107,7 +108,7 @@ public class ConfigManager {          double x = section.getDouble("x");          double y = section.getDouble("y");          double z = section.getDouble("x"); -        if (x==0 || y == 0 || z == 0) { +        if (x == 0 || y == 0 || z == 0) {              Result<Location> res = new Result<>();              res.success = false;              res.error = "Arena coordinates are missing or are zero. Coordinates cannot be zero."; @@ -138,7 +139,7 @@ public class ConfigManager {      public static void WriteConfig() {          if (waitArea != null) { -            WriteWorld(plugin.getConfig().getConfigurationSection("wait-area"), waitArea); +            WriteWorld(Objects.requireNonNull(plugin.getConfig().getConfigurationSection("wait-area")), waitArea);              plugin.getConfig().set("enable-wait-area", true);          }          else { @@ -146,11 +147,11 @@ public class ConfigManager {          }          if (lobby != null) { -            WriteWorld(plugin.getConfig().getConfigurationSection("lobby-spawn"), lobby); +            WriteWorld(Objects.requireNonNull(plugin.getConfig().getConfigurationSection("lobby-spawn")), lobby);          }          if (winnerLobby != null) { -            WriteWorld(plugin.getConfig().getConfigurationSection("winner-spawn"), winnerLobby); +            WriteWorld(Objects.requireNonNull(plugin.getConfig().getConfigurationSection("winner-spawn")), winnerLobby);              plugin.getConfig().set("enable-winner-lobby", true);          }          else { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 0d9b70c..8bb306e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -7,29 +7,29 @@ load: POSTWORLD  author: MylesAndMore  website: https://github.com/MylesAndMore/Tumble  commands: -  join: +  tumble-join:      description: Joins a Tumble match. -    usage: '§cUsage: /tumble:join <arenaName> [gameType]' +    usage: '§cUsage: /tumble-join <arenaName> [gameType]'      permission: tumble.join -  leave: +  tumble-leave:      description: Quits a Tumble match. -    usage: '§cUsage: /tumble:leave' +    usage: '§cUsage: /tumble-leave'      permission: tumble.leave -  forcestart: +  tumble-forcestart:      description: Force starts a Tumble match. -    usage: '§cUsage: /tumble:forcestart [arenaName]' +    usage: '§cUsage: /tumble-forcestart [arenaName]'      permission: tumble.forcestart -  forcestop: +  tumble-forcestop:      description: Force stops a Tumble match. -    usage: '§cUsage: /tumble:forcestop [arenaName]' +    usage: '§cUsage: /tumble-forcestop [arenaName]'      permission: tumble.forcestop -  config: +  tumble-config:      description: Modify arenas and worlds. -    usage: '§cUsage: /tumble:config <add|set|disable|delete> <data>' +    usage: '§cUsage: /tumble-config <add|set|disable|delete> <data>'      permission: tumble.config -  reload: +  tumble-reload:      description: Reloads the plugin's config. -    usage: '§cUsage: /tumble:reload' +    usage: '§cUsage: /tumble-reload'      permission: tumble.reload  permissions:    tumble.join: | 
