Finished Testing Command

This commit is contained in:
alisolarflare 2016-10-21 21:38:22 -04:00
parent 587586bd90
commit ede758e2b5
3 changed files with 35 additions and 8 deletions

View file

@ -19,7 +19,34 @@ public class gPowerCommand implements CommandExecutor{
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("Proper Usage to test G-Powers:");
player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]");
return false;
}
boolean isActive;
if(args[1].startsWith("t")){
isActive = true;
}else if (args[1].startsWith("f")){
isActive = false;
}else{
player.sendMessage("Proper Usage to test G-Powers:");
player.sendMessage("/gpowertest [colour=red,orange,yellow,green,blue,purple] [active=true/false]");
return false;
}
if(isActive){
gPowerMemory.PowerUpPlayer(player, colour);
}else{
gPowerMemory.PowerDownPlayer(player);
}
return false;
}

View file

@ -18,7 +18,7 @@ public class gPowerMemory {
public static Map<UUID, poweredPlayer> PlayerMap = new HashMap<UUID, poweredPlayer>();
//POWER ACTIVATION
public void PowerUpPlayer(Player player, String colour){
public static void PowerUpPlayer(Player player, String colour){
if (PlayerMap.containsKey(player.getUniqueId())){
PlayerMap.get(player.getUniqueId()).playerPowersActivated = true;
}else{
@ -27,7 +27,7 @@ public class gPowerMemory {
}
//POWER DEACTIVATION
public void PowerDownPlayer(Player player){
public static void PowerDownPlayer(Player player){
if (PlayerMap.containsKey(player.getUniqueId())){
PlayerMap.get(player.getUniqueId()).playerPowersActivated = false;
}else{
@ -35,21 +35,21 @@ public class gPowerMemory {
}
}
public void PowerDownPlayer(UUID UniqueID){
public static void PowerDownPlayer(UUID UniqueID){
if (PlayerMap.containsKey(UniqueID)){
PlayerMap.get(UniqueID).playerPowersActivated = false;
}else{
return;
}
}
public boolean isPlayerPowered(UUID UniqueID){
public static boolean isPlayerPowered(UUID UniqueID){
if (PlayerMap.containsKey(UniqueID)){
return PlayerMap.get(UniqueID).playerPowersActivated;
}else{
return false;
}
}
public boolean isPlayerPowered(Player player){
public static boolean isPlayerPowered(Player player){
if (PlayerMap.containsKey(player.getUniqueId())){
return PlayerMap.get(player.getUniqueId()).playerPowersActivated;
}else{
@ -57,7 +57,7 @@ public class gPowerMemory {
}
}
//MEMORY UNIT
public class poweredPlayer{
public static class poweredPlayer{
public UUID uuid;
public String colour;
public Boolean playerPowersActivated;

View file

@ -11,7 +11,7 @@ import alisolarflare.gpowers.gPowerMemory;
public class gPowerApplyingTask extends BukkitRunnable{
private AliPresents plugin;;
private AliPresents plugin;
public gPowerApplyingTask(AliPresents plugin) {
this.plugin = plugin;