Finally finished first wave of bugfixing #35

Merged
alisolarflare merged 11 commits from Bugfix into master 2016-12-19 03:19:49 +00:00
3 changed files with 53 additions and 51 deletions
Showing only changes of commit 812dd89ee0 - Show all commits

View file

@ -21,7 +21,6 @@ import buttondevteam.lib.chat.TBMCChatAPI;
* *
*/ */
public abstract class Component{ public abstract class Component{
/** /**
* Registers the module, when called by the JavaPlugin class. Call * Registers the module, when called by the JavaPlugin class. Call
* registerCommand() and registerListener() within this method. * registerCommand() and registerListener() within this method.

View file

@ -3,7 +3,7 @@ package buttondevteam.alipresents.components.gpower;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.architecture.Component; 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.enchant.EnchantingLoop;
import buttondevteam.alipresents.components.gpower.powerstate.PowerDown; import buttondevteam.alipresents.components.gpower.powerstate.PowerDown;
import buttondevteam.alipresents.components.gpower.powerstate.PowerUp; import buttondevteam.alipresents.components.gpower.powerstate.PowerUp;
@ -12,7 +12,7 @@ public class GPowerComponent extends Component {
@Override @Override
public void register(JavaPlugin plugin) { public void register(JavaPlugin plugin) {
registerCommand(plugin, new GPower()); registerCommand(plugin, new Test());
registerCommand(plugin, new PowerUp()); registerCommand(plugin, new PowerUp());
registerCommand(plugin, new PowerDown()); registerCommand(plugin, new PowerDown());

View file

@ -1,48 +1,51 @@
package buttondevteam.alipresents.components.gpower.commands; package buttondevteam.alipresents.components.gpower.commands;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import buttondevteam.alipresents.architecture.commands.PlayerCommand; import buttondevteam.alipresents.architecture.commands.ModCommand;
import buttondevteam.alipresents.components.gpower.api.GPowerAPI; import buttondevteam.alipresents.components.gpower.api.GPowerAPI;
public class GPower extends PlayerCommand { public class Test extends ModCommand{
@Override
public String GetCommandPath() { @Override
return "gpower"; public boolean OnCommand(Player player, String alias, String[] args) {
} if (args.length < 2) {
@Override player.sendMessage("Proper Usage to test G-Powers:");
public boolean OnCommand(Player player, String label, String[] args) { player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]");
if (args.length < 2) { return false;
player.sendMessage("Proper Usage to test G-Powers:"); }
player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]"); String colour;
return false; 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")) {
String colour; colour = args[0];
if (args[0].startsWith("r") || args[0].startsWith("o") || args[0].startsWith("y") || args[0].startsWith("g") } else {
|| args[0].startsWith("b") || args[0].startsWith("p")) { player.sendMessage("error: colour. Proper Usage to configure G-Powers:");
colour = args[0]; return false;
} else { }
player.sendMessage("error: colour. Proper Usage to configure G-Powers:"); boolean isActive;
return false; if (args[1].startsWith("t")) {
} isActive = true;
boolean isActive; } else if (args[1].startsWith("f")) {
if (args[1].startsWith("t")) { isActive = false;
isActive = true; } else {
} else if (args[1].startsWith("f")) { player.sendMessage("error: active. Proper Usage to configure G-Powers:");
isActive = false; return false;
} else { }
player.sendMessage("error: active. Proper Usage to configure G-Powers:"); player.sendMessage("Terms Vaild!");
return false; player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive);
} GPowerAPI.addPlayer(player, colour, isActive);
player.sendMessage("Terms Vaild!");
player.sendMessage("Saving Data: "+ player.getName() + "|" + colour + "|" + isActive); return true;
GPowerAPI.addPlayer(player, colour, isActive); }
@Override
return true; public String GetCommandPath() {
} return "gpower test";
public String[] GetHelpText(String alias){ }
return new String[]{ @Override
"Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]" public String[] GetHelpText(String alias){
}; return new String[]{
} "Usage: /gpowertest [colour=red,orange,yellow,green,blue,purple,grey] [active=true/false]"
} };
}
}