From 56a087612b4aef0146845fac5e1d7a885023c776 Mon Sep 17 00:00:00 2001 From: phobia Date: Mon, 4 Apr 2016 16:58:16 +1000 Subject: [PATCH] Changes to explain energy goal --- .../goals/energy/ExplainEnergyGoal.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/ExplainEnergyGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/ExplainEnergyGoal.java index 9123cd0ce..f4267c521 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/ExplainEnergyGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/energy/ExplainEnergyGoal.java @@ -1,5 +1,6 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.energy; +import mineplex.game.clans.clans.event.ClansCommandPreExecutedEvent; import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent; import org.bukkit.Sound; import org.bukkit.entity.Player; @@ -31,17 +32,7 @@ public class ExplainEnergyGoal extends ObjectiveGoal @Override protected void customStart(Player player) { - ClansManager.getInstance().runSyncLater(() -> { - // Explain Energy - UtilPlayer.message(player, F.main("Clans", "Energy is required to maintain a Clan's territory, without it, any territory that your Clan owns will be claimed by the Wilderness, and anyone will be able to claim that territory. You can buy Energy at the Energy Shop in the Shops.")); - player.playSound(player.getLocation(), Sound.NOTE_PLING, 1.0f, 1.0f); - - ClansManager.getInstance().runSyncLater(() -> { - finish(player); - }, 20 * 10L); - }, 20 * 3L); - -// setStartMessageDelay(120); + player.playSound(player.getLocation(), Sound.NOTE_PLING, 1.0f, 1.0f); } @Override @@ -49,6 +40,14 @@ public class ExplainEnergyGoal extends ObjectiveGoal { } + @EventHandler + public void onCommand(ClansCommandPreExecutedEvent event) + { + if(contains(event.getPlayer()) && event.getArguments().length == 0) + { + finish(event.getPlayer()); + } + } @EventHandler(priority = EventPriority.HIGHEST) public void onClick(ClansButtonClickEvent event) {