From bbacdc3529485d4e1db7ba765b03ca0072aa9b33 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Sun, 6 Nov 2016 17:12:24 -0500 Subject: [PATCH] Tried to fix up powerup --- plugin.yml | 2 ++ .../components/flairdoor/FlairDoorModule.java | 1 - .../flairdoor/commands/FlairMe.java | 3 +- .../flairdoor/listeners/PortalListener.java | 29 +++++++------------ .../components/gpowers/GPowerMemory.java | 5 ++++ .../components/gpowers/commands/PowerUp.java | 1 + .../uhc/intro/IntroductionCutscene.java | 5 ++++ src/alisolarflare/uhc/memory/UHCMatch.java | 4 +++ 8 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 src/alisolarflare/uhc/intro/IntroductionCutscene.java diff --git a/plugin.yml b/plugin.yml index bc68779..2bf7be2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -29,6 +29,8 @@ commands: description: List all fighters currently in a button minigame setcolourspawn: description: sets the spawn points for each colour in a button minigame + setmatchstate: + description: sets the current state of the ultrahardcore game. addtouhc: description: Adds a player to the UltraHardcore match joinuhc: diff --git a/src/alisolarflare/components/flairdoor/FlairDoorModule.java b/src/alisolarflare/components/flairdoor/FlairDoorModule.java index c7e266a..1c5cddb 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorModule.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorModule.java @@ -10,7 +10,6 @@ public class FlairDoorModule extends Module { @Override public void register(JavaPlugin plugin) { registerCommand(plugin, new FlairMe()); - registerListener(plugin, new PortalListener(plugin)); } } diff --git a/src/alisolarflare/components/flairdoor/commands/FlairMe.java b/src/alisolarflare/components/flairdoor/commands/FlairMe.java index 548fe9a..963da82 100644 --- a/src/alisolarflare/components/flairdoor/commands/FlairMe.java +++ b/src/alisolarflare/components/flairdoor/commands/FlairMe.java @@ -9,9 +9,8 @@ public class FlairMe extends TBMCCommandBase { @Override public boolean OnCommand(CommandSender sender, String label, String[] args) { - sender.sendMessage("Flairing..." + sender.getName()); PortalListener.playersToBeFlaired.add(sender.getName()); - sender.sendMessage("Finished Preparation! Walk through a portal to get your flair"); + sender.sendMessage("Setup Successful! Walk through a portal to get your flair"); return false; } diff --git a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java index 82d186d..4ce684a 100644 --- a/src/alisolarflare/components/flairdoor/listeners/PortalListener.java +++ b/src/alisolarflare/components/flairdoor/listeners/PortalListener.java @@ -57,19 +57,15 @@ public class PortalListener implements Listener{ //RECOLOUR PLAYER if(HigherBlock.getType() == Material.STONE){ - player.sendMessage("STONE DETECTED"); recolourPlayer(player, DyeColor.GRAY); //TOP BLOCK IS WOOL? }else if(HigherBlock.getType() == Material.WOOL){ - player.sendMessage("WOOL DETECTED T"); Wool wool = (Wool) HigherBlock.getState().getData(); recolourPlayer(player, wool.getColor()); //MIDDLE BLOCK IS WOOL? }else if(MiddleBlock.getType() == Material.WOOL){ - - player.sendMessage("WOOL DETECTED M"); MaterialData mData = MiddleBlock.getState().getData(); Wool wool = (Wool) mData; @@ -77,7 +73,6 @@ public class PortalListener implements Listener{ //BOTTOM BLOCK IS WOOL? }else if (BottomBlock.getType() == Material.WOOL){ - player.sendMessage("WOOL DETECTED B"); Wool wool = (Wool) BottomBlock.getState().getData(); recolourPlayer(player, wool.getColor()); } @@ -86,60 +81,58 @@ public class PortalListener implements Listener{ public void recolourPlayer(Player player, DyeColor dyecolour){ User user = essentials.getUser(player); - player.sendMessage("Recolouring Player as..." + dyecolour.toString()); String name = user._getNickname(); - player.sendMessage("name:" + name); String tempName = ""; for(int i = 0; i < name.length(); i++){ - player.sendMessage("|"+name.charAt(i)+"|"); if (name.charAt(i) != '§'){ - tempName += name.charAt(i); }else{ i++; } } name = tempName; - player.sendMessage("Adjusted Name: " + name); switch(dyecolour){ case GRAY: - player.sendMessage("Adding GRAY"); + player.sendMessage("Adding §7GRAY!§f"); name = "§7" + name; break; case RED: - player.sendMessage("Adding RED"); + player.sendMessage("Adding §4RED!§f"); name = "§4" + name; break; case ORANGE: - player.sendMessage("Adding ORANGE"); + player.sendMessage("Adding §6ORANGE!§f"); name = "§6" + name; break; case YELLOW: - player.sendMessage("Adding YELLOW"); + player.sendMessage("Adding §eYELLOW!§f"); name = "§e" + name; break; case LIME: case GREEN: - player.sendMessage("Adding GREEN"); + player.sendMessage("Adding §aGREEN!§f"); name = "§a" + name; break; case CYAN: case LIGHT_BLUE: case BLUE: - player.sendMessage("Adding BLUE"); + player.sendMessage("Adding §9BLUE!§f"); name = "§9" + name; break; case PURPLE: - player.sendMessage("Adding PURPLE"); + player.sendMessage("Adding §5PURPLE!§f"); name = "§5" + name; break; + case WHITE: + player.sendMessage("Adding §fWHITE!§f"); + name = "§f" + name; default: player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); break; } user.setNickname(name); - player.sendMessage("Your name is now: " + user.getNickname() +"! Removing you from playersToBeFlaired..."); + player.sendMessage("Your name is now: " + user.getNickname() +"!"); playersToBeFlaired.remove(player.getName()); } } diff --git a/src/alisolarflare/components/gpowers/GPowerMemory.java b/src/alisolarflare/components/gpowers/GPowerMemory.java index 0dda7b9..44e0089 100644 --- a/src/alisolarflare/components/gpowers/GPowerMemory.java +++ b/src/alisolarflare/components/gpowers/GPowerMemory.java @@ -13,17 +13,22 @@ public class GPowerMemory{ poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); } public void PowerUpPlayer(Player player){ + player.sendMessage("Powering up!"); if(poweredPlayerList.containsKey(player.getUniqueId())){ poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; + player.sendMessage("Powered up!"); }else{ player.sendMessage("You must instantiate your power settings using /GPower"); } } public void PowerDownPlayer(Player player){ + player.sendMessage("Powering down!"); if (poweredPlayerList.containsKey(player.getUniqueId())){ + player.sendMessage("Powered down!"); poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; }else{ + player.sendMessage("P down!"); return; } diff --git a/src/alisolarflare/components/gpowers/commands/PowerUp.java b/src/alisolarflare/components/gpowers/commands/PowerUp.java index 2e50db8..84670f3 100644 --- a/src/alisolarflare/components/gpowers/commands/PowerUp.java +++ b/src/alisolarflare/components/gpowers/commands/PowerUp.java @@ -18,6 +18,7 @@ public class PowerUp extends TBMCCommandBase { public boolean OnCommand(CommandSender sender, String label, String[] args) { if (!(sender instanceof Player)) sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); + Player player = (Player) sender; gPowerMemory.PowerUpPlayer(player); return false; diff --git a/src/alisolarflare/uhc/intro/IntroductionCutscene.java b/src/alisolarflare/uhc/intro/IntroductionCutscene.java new file mode 100644 index 0000000..6ff7ce5 --- /dev/null +++ b/src/alisolarflare/uhc/intro/IntroductionCutscene.java @@ -0,0 +1,5 @@ +package alisolarflare.uhc.intro; + +public class IntroductionCutscene { + //TODO: Teleport all players to the area. +} diff --git a/src/alisolarflare/uhc/memory/UHCMatch.java b/src/alisolarflare/uhc/memory/UHCMatch.java index 42b0484..4c4049a 100644 --- a/src/alisolarflare/uhc/memory/UHCMatch.java +++ b/src/alisolarflare/uhc/memory/UHCMatch.java @@ -23,6 +23,10 @@ public class UHCMatch { public void setMatchState(MatchState newMS){ matchState = newMS; fileConfiguration.set("UHCMatchState", newMS.toString()); + switch(newMS){ + default: + break; + } } }