From 6bf284d0c98ce4ccfd49da464e8340706fe69c91 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 24 Oct 2017 14:53:37 +0100 Subject: [PATCH] Cleanup FloorIsLava Achievement --- .../cakewars/trackers/FloorIsLavaTracker.java | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/trackers/FloorIsLavaTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/trackers/FloorIsLavaTracker.java index adf88972b..2e949fa00 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/trackers/FloorIsLavaTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/cakewars/trackers/FloorIsLavaTracker.java @@ -9,7 +9,6 @@ import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; import mineplex.core.common.util.UtilTime; import mineplex.core.updater.UpdateType; @@ -35,14 +34,16 @@ public class FloorIsLavaTracker extends StatTracker } @EventHandler - public void live(GameStateChangeEvent event) + public void gameStateChange(GameStateChangeEvent event) { - if (event.GetState() != GameState.Live) + if (event.GetState() == GameState.Live) { - return; + _successful.addAll(getGame().GetPlayers(true)); + } + else if (event.GetState() == GameState.End) + { + _successful.forEach(player -> addStat(player, "FloorIsLava", 1, true, false)); } - - _successful.addAll(getGame().GetPlayers(true)); } @EventHandler @@ -67,15 +68,4 @@ public class FloorIsLavaTracker extends StatTracker return !blocks.contains(block) && !blocks.contains(block.getRelative(BlockFace.DOWN)) && !getGame().getCakeShopModule().isNearShop(location); }); } - - @EventHandler(priority = EventPriority.MONITOR) - public void onGameStateChange(GameStateChangeEvent event) - { - if (event.GetState() != GameState.End) - { - return; - } - - _successful.forEach(player -> addStat(player, "FloorIsLava", 1, true, false)); - } }