From b4ce33a916246263f3c53e820c5fa4a0f1c1f4f6 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Tue, 1 Sep 2015 01:59:36 -0400 Subject: [PATCH] Fixed things. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added a cancelled check to No Ability • Removed tokens on quit. • Checked if players are alive before giving them places. --- .../game/games/evolution/Evolution.java | 35 +++++++++++-------- .../evolution/trackers/NoAbilityTracker.java | 3 ++ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java index 62978c22b..1d4506b45 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/Evolution.java @@ -73,6 +73,7 @@ import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerItemHeldEvent; +import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.util.Vector; public class Evolution extends SoloGame @@ -141,7 +142,7 @@ public class Evolution extends SoloGame GemAssistDeathRespawn = .5; CompassEnabled = true; - CompassGiveItem = false; + CompassGiveItem = false; AutomaticRespawn = false; DeathSpectateSecs = 4.0; @@ -149,8 +150,7 @@ public class Evolution extends SoloGame VersionRequire1_8 = true; CreatureAllow = false; - - InventoryClick = false; + InventoryClick = false; InventoryOpenBlock = false; @@ -223,6 +223,12 @@ public class Evolution extends SoloGame upgradeKit(event.GetPlayer(), false); } + @EventHandler + public void removeToken(PlayerQuitEvent event) + { + _tokens.remove(event.getPlayer().getName()); + } + // //Double Kit // @EventHandler(priority = EventPriority.MONITOR) // public void storeTokens(GameStateChangeEvent event) @@ -414,7 +420,7 @@ public class Evolution extends SoloGame } } - @EventHandler + @EventHandler(priority = EventPriority.MONITOR) public void onKill(CombatDeathEvent event) { event.SetBroadcastType(DeathMessageType.Simple); @@ -747,7 +753,11 @@ public class Evolution extends SoloGame for (int i = 0 ; i < tokens.size() ; i++) { - players.add(tokens.get(i).Player); + Player cur = tokens.get(i).Player; + if (!cur.isOnline()) + continue; + + players.add(cur); } //Award Gems @@ -804,19 +814,14 @@ public class Evolution extends SoloGame Scoreboard.WriteBlank(); - int index = 0; + Scoreboard.Write(C.cYellow + C.Bold + "First to " + _mobKits.size()); + + Scoreboard.WriteBlank(); + for (Player player : GetPlayers(true)) { - if (index > 11) - break; - - Scoreboard.WriteOrdered("Score", C.cGreen + player.getName(), getScore(player), true); - index++; + Scoreboard.WriteOrdered("Score", C.cGreen + player.getName(), getScore(player), true); } - - Scoreboard.WriteBlank(); - - Scoreboard.Write(C.cGold + C.Bold + "First to " + _mobKits.size()); Scoreboard.Draw(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/trackers/NoAbilityTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/trackers/NoAbilityTracker.java index 655eb6f79..68b0cee22 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/trackers/NoAbilityTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/trackers/NoAbilityTracker.java @@ -29,6 +29,9 @@ public class NoAbilityTracker extends StatTracker @EventHandler(priority = EventPriority.MONITOR) public void onEvolutionAbility(EvolutionAbilityUseEvent event) { + if (event.isCancelled()) + return; + if (!getGame().IsLive()) return;