From 812dd89ee0f2e2cb335d81ee6301f8c5d4694e7e Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sat, 17 Dec 2016 04:23:57 -0500 Subject: [PATCH] #27 Actually fixed the thing --- .../alipresents/architecture/Component.java | 1 - .../components/gpower/GPowerComponent.java | 4 +- .../commands/{GPower.java => Test.java} | 99 ++++++++++--------- 3 files changed, 53 insertions(+), 51 deletions(-) rename src/buttondevteam/alipresents/components/gpower/commands/{GPower.java => Test.java} (78%) diff --git a/src/buttondevteam/alipresents/architecture/Component.java b/src/buttondevteam/alipresents/architecture/Component.java index a08bee6..af43424 100644 --- a/src/buttondevteam/alipresents/architecture/Component.java +++ b/src/buttondevteam/alipresents/architecture/Component.java @@ -21,7 +21,6 @@ import buttondevteam.lib.chat.TBMCChatAPI; * */ public abstract class Component{ - /** * Registers the module, when called by the JavaPlugin class. Call * registerCommand() and registerListener() within this method. diff --git a/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java index 295cc6b..1d85e84 100644 --- a/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java +++ b/src/buttondevteam/alipresents/components/gpower/GPowerComponent.java @@ -3,7 +3,7 @@ package buttondevteam.alipresents.components.gpower; import org.bukkit.plugin.java.JavaPlugin; import buttondevteam.alipresents.architecture.Component; -import buttondevteam.alipresents.components.gpower.commands.GPower; +import buttondevteam.alipresents.components.gpower.commands.Test; import buttondevteam.alipresents.components.gpower.enchant.EnchantingLoop; import buttondevteam.alipresents.components.gpower.powerstate.PowerDown; import buttondevteam.alipresents.components.gpower.powerstate.PowerUp; @@ -12,7 +12,7 @@ public class GPowerComponent extends Component { @Override public void register(JavaPlugin plugin) { - registerCommand(plugin, new GPower()); + registerCommand(plugin, new Test()); registerCommand(plugin, new PowerUp()); registerCommand(plugin, new PowerDown()); diff --git a/src/buttondevteam/alipresents/components/gpower/commands/GPower.java b/src/buttondevteam/alipresents/components/gpower/commands/Test.java similarity index 78% rename from src/buttondevteam/alipresents/components/gpower/commands/GPower.java rename to src/buttondevteam/alipresents/components/gpower/commands/Test.java index 9c95f31..07dc669 100644 --- a/src/buttondevteam/alipresents/components/gpower/commands/GPower.java +++ b/src/buttondevteam/alipresents/components/gpower/commands/Test.java @@ -1,48 +1,51 @@ -package buttondevteam.alipresents.components.gpower.commands; - -import org.bukkit.entity.Player; - -import buttondevteam.alipresents.architecture.commands.PlayerCommand; -import buttondevteam.alipresents.components.gpower.api.GPowerAPI; - -public class GPower extends PlayerCommand { - @Override - public String GetCommandPath() { - return "gpower"; - } - @Override - public boolean OnCommand(Player player, String label, String[] args) { - if (args.length < 2) { - player.sendMessage("Proper Usage to test G-Powers:"); - player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); - return false; - } - String colour; - if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") - || args[0].startsWith("b") || args[0].startsWith("p")) { - colour = args[0]; - } else { - player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); - return false; - } - boolean isActive; - if (args[1].startsWith("t")) { - isActive = true; - } else if (args[1].startsWith("f")) { - isActive = false; - } else { - player.sendMessage("error: active. Proper Usage to configure G-Powers:"); - return false; - } - player.sendMessage("Terms Vaild!"); - player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); - GPowerAPI.addPlayer(player, colour, isActive); - - return true; - } - public String[] GetHelpText(String alias){ - return new String[]{ - "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" - }; - } -} +package buttondevteam.alipresents.components.gpower.commands; + +import org.bukkit.entity.Player; + +import buttondevteam.alipresents.architecture.commands.ModCommand; +import buttondevteam.alipresents.components.gpower.api.GPowerAPI; + +public class Test extends ModCommand{ + + @Override + public boolean OnCommand(Player player, String alias, String[] args) { + if (args.length < 2) { + player.sendMessage("Proper Usage to test G-Powers:"); + player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); + return false; + } + String colour; + if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") + || args[0].startsWith("b") || args[0].startsWith("p")) { + colour = args[0]; + } else { + player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); + return false; + } + boolean isActive; + if (args[1].startsWith("t")) { + isActive = true; + } else if (args[1].startsWith("f")) { + isActive = false; + } else { + player.sendMessage("error: active. Proper Usage to configure G-Powers:"); + return false; + } + player.sendMessage("Terms Vaild!"); + player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); + GPowerAPI.addPlayer(player, colour, isActive); + + return true; + } + @Override + public String GetCommandPath() { + return "gpower test"; + } + @Override + public String[] GetHelpText(String alias){ + return new String[]{ + "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" + }; + } + +}