From 15bd5160960a7903ba2965b11f834edbfc9ea6ae Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 18:48:07 -0500 Subject: [PATCH] Fixed plugin.yml --- plugin.yml | 10 ++++--- src/alisolarflare/AliPresents.java | 2 -- src/alisolarflare/easyuhc/EasyUHCModule.java | 15 ++++++++++ .../easyuhc/gpowers/GPowerModule.java | 23 --------------- .../easyuhc/gpowers/commands/PowerAll.java | 28 +++++++++++++++++++ .../gpowers/listeners/gPowerApplyingTask.java | 5 +++- .../gpowers/listeners/gPowerListener.java | 2 +- 7 files changed, 54 insertions(+), 31 deletions(-) delete mode 100644 src/alisolarflare/easyuhc/gpowers/GPowerModule.java create mode 100644 src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java diff --git a/plugin.yml b/plugin.yml index 4b18371..1bbfbb3 100644 --- a/plugin.yml +++ b/plugin.yml @@ -4,7 +4,7 @@ version: 2.0.1 commands: flairme: - description: Activates the Flair Me Command. Ask Ali, she was tired when writing this description + description: Activates the Flair Me Command. Ask Ali - she was tired when writing this description gpower: description: Testing command for ghostie powers powerup: @@ -16,9 +16,9 @@ commands: setalilink: description: Creates an Ali Link setalilink frequency cbgm0: - description: Creative Boundaries Gamemode 0, allows players to return to survival + description: Creative Boundaries Gamemode 0 - allows players to return to survival cbgm1: - description: Creative Boundaries Gamemode 1, allows players to access creative within their towns. Creative is removed outside of towns, so be careful + description: Creative Boundaries Gamemode 1 - allows players to access creative within their towns. Creative is removed outside of towns, so be careful setdickmode: description: Should players automatically return to creative when outside town borders? Dickmode says yes. joinminigame: @@ -54,4 +54,6 @@ commands: startuhc: description: starts an ultrahardcore match starttimer: - description: starts an ultrahardcore timer \ No newline at end of file + description: starts an ultrahardcore timer + powerall: + description: activate every player's power \ No newline at end of file diff --git a/src/alisolarflare/AliPresents.java b/src/alisolarflare/AliPresents.java index 04b65fc..7646d71 100644 --- a/src/alisolarflare/AliPresents.java +++ b/src/alisolarflare/AliPresents.java @@ -10,7 +10,6 @@ import alisolarflare.components.flairdoor.FlairDoorModule; import alisolarflare.components.links.AliLinkModule; import alisolarflare.creativeboundaries.CreativeBoundariesModule; import alisolarflare.easyuhc.EasyUHCModule; -import alisolarflare.easyuhc.gpowers.GPowerModule; import alisolarflare.magic.MagicModule; import alisolarflare.minigames.MinigameModule; @@ -23,7 +22,6 @@ public class AliPresents extends JavaPlugin{ new FlairDoorModule().register(this); - new GPowerModule().register(this); new AliLinkModule().register(this); new EasyUHCModule().register(this); new MagicModule().register(this); diff --git a/src/alisolarflare/easyuhc/EasyUHCModule.java b/src/alisolarflare/easyuhc/EasyUHCModule.java index b96d80b..2ca862c 100644 --- a/src/alisolarflare/easyuhc/EasyUHCModule.java +++ b/src/alisolarflare/easyuhc/EasyUHCModule.java @@ -11,11 +11,25 @@ import alisolarflare.easyuhc.commands.SpreadPlayers; import alisolarflare.easyuhc.commands.StartTimer; import alisolarflare.easyuhc.commands.StartUHC; import alisolarflare.easyuhc.commands.TeleportToUHC; +import alisolarflare.easyuhc.gpowers.GPowerMemory; +import alisolarflare.easyuhc.gpowers.commands.GPower; +import alisolarflare.easyuhc.gpowers.commands.PowerDown; +import alisolarflare.easyuhc.gpowers.commands.PowerUp; +import alisolarflare.easyuhc.gpowers.listeners.gPowerListener; public class EasyUHCModule extends Module{ public Location lobbyLocation; @Override public void register(JavaPlugin plugin) { + + + GPowerMemory gPowerMemory = new GPowerMemory(); + registerCommand(plugin, new GPower(gPowerMemory)); + registerCommand(plugin, new PowerUp(gPowerMemory)); + registerCommand(plugin, new PowerDown(gPowerMemory)); + + registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); + registerCommand(plugin, new ActivatePowers()); registerCommand(plugin, new SetUHCLobby(this)); registerCommand(plugin, new SetWorldBorders()); @@ -24,5 +38,6 @@ public class EasyUHCModule extends Module{ registerCommand(plugin, new StartTimer()); registerCommand(plugin, new StartUHC()); registerCommand(plugin, new TeleportToUHC()); + } } diff --git a/src/alisolarflare/easyuhc/gpowers/GPowerModule.java b/src/alisolarflare/easyuhc/gpowers/GPowerModule.java deleted file mode 100644 index 2b0dfd4..0000000 --- a/src/alisolarflare/easyuhc/gpowers/GPowerModule.java +++ /dev/null @@ -1,23 +0,0 @@ -package alisolarflare.easyuhc.gpowers; - -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.Module; -import alisolarflare.easyuhc.gpowers.commands.GPower; -import alisolarflare.easyuhc.gpowers.commands.PowerDown; -import alisolarflare.easyuhc.gpowers.commands.PowerUp; -import alisolarflare.easyuhc.gpowers.listeners.gPowerListener; - -public class GPowerModule extends Module { - - @Override - public void register(JavaPlugin plugin) { - GPowerMemory gPowerMemory = new GPowerMemory(); - registerCommand(plugin, new GPower(gPowerMemory)); - registerCommand(plugin, new PowerUp(gPowerMemory)); - registerCommand(plugin, new PowerDown(gPowerMemory)); - - registerListener(plugin, new gPowerListener(plugin, gPowerMemory)); - } - -} diff --git a/src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java b/src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java new file mode 100644 index 0000000..706d764 --- /dev/null +++ b/src/alisolarflare/easyuhc/gpowers/commands/PowerAll.java @@ -0,0 +1,28 @@ +package alisolarflare.easyuhc.gpowers.commands; + +import org.bukkit.command.CommandSender; + +import alisolarflare.DevCommand; +import alisolarflare.easyuhc.gpowers.GPowerMemory; +import alisolarflare.easyuhc.gpowers.GPowerMemory.poweredPlayer; + +public class PowerAll extends DevCommand{ + private GPowerMemory gPowerMemory; + + public PowerAll(GPowerMemory gPowerMemory) { + this.gPowerMemory = gPowerMemory; + } + @Override + public boolean OnCommand(CommandSender sender, String alias, String[] args) { + for (poweredPlayer poweredPlayer : gPowerMemory.poweredPlayerList.values()){ + poweredPlayer.isPowersActive = true; + } + return false; + } + + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } +} diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java index 04d7369..35dcec2 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java +++ b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerApplyingTask.java @@ -13,7 +13,7 @@ import org.bukkit.scheduler.BukkitRunnable; import alisolarflare.easyuhc.gpowers.GPowerMemory.poweredPlayer; public class gPowerApplyingTask extends BukkitRunnable{ - private int powerLength = 200; + private int powerLength = 300; private Server server; private Map poweredPlayerList; @@ -35,6 +35,9 @@ public class gPowerApplyingTask extends BukkitRunnable{ private void activatePower(Player player, String colour) { //GREY + for (PotionEffect potionEffect : player.getActivePotionEffects()){ + player.removePotionEffect(potionEffect.getType()); + } if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); diff --git a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java index 802bb63..76bae71 100644 --- a/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java +++ b/src/alisolarflare/easyuhc/gpowers/listeners/gPowerListener.java @@ -8,6 +8,6 @@ import alisolarflare.easyuhc.gpowers.GPowerMemory; public class gPowerListener implements Listener{ public gPowerListener(JavaPlugin plugin, GPowerMemory gPowerMemory){ - new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 190, 190); + new gPowerApplyingTask(plugin.getServer(), gPowerMemory.poweredPlayerList).runTaskTimer(plugin, 0, 190); } } \ No newline at end of file