Fixed trackers

This commit is contained in:
Mysticate 2015-09-24 23:02:19 -04:00
parent a9f20a573c
commit 60c4e5812a
2 changed files with 9 additions and 3 deletions

View File

@ -30,6 +30,7 @@ import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.monstermaze.MMMazes.MazePreset;
import nautilus.game.arcade.game.games.monstermaze.MazeMobWaypoint.CardinalDirection;
import nautilus.game.arcade.game.games.monstermaze.events.AbilityUseEvent;
import nautilus.game.arcade.game.games.monstermaze.events.FirstToSafepadEvent;
import nautilus.game.arcade.game.games.monstermaze.events.SafepadBuildEvent;
import nautilus.game.arcade.game.games.monstermaze.events.SnowmanHitEvent;
import nautilus.game.arcade.game.games.monstermaze.kits.KitSmasher;
@ -783,7 +784,7 @@ public class Maze implements Listener
Host.AddGems(p, 2, "Safe Pads Reached", true, true);
if (_playersOnPad.size() == 1) // first player
{
{
Host.Announce(F.main("Game", F.name(p.getName()) + " made it to the Safe Pad first!"));
UtilTextMiddle.display("", C.cYellow + C.Bold + "You got to the Safe Pad first!", 5, 40, 5, p);
@ -799,6 +800,8 @@ public class Maze implements Listener
UtilPlayer.message(player, F.main("Game", "You have " + F.time("15 Seconds") + " to make it to the Safe Pad!"));
}
Bukkit.getPluginManager().callEvent(new FirstToSafepadEvent(p));
}
else // not the first
{

View File

@ -3,7 +3,6 @@ package nautilus.game.arcade.game.games.monstermaze.trackers;
import java.util.concurrent.ConcurrentHashMap;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
@ -53,7 +52,7 @@ public class PilotTracker extends StatTracker<MonsterMaze>
for (Player player : _launched.keySet())
{
if (player == null || !player.isOnline() || !getGame().IsAlive(player) || UtilPlayer.isSpectator(player))
if (player == null || !player.isOnline() || !getGame().IsAlive(player))
{
_launched.remove(player);
@ -64,12 +63,16 @@ public class PilotTracker extends StatTracker<MonsterMaze>
if (UtilEnt.isGrounded(player))
{
System.out.println("launched player is grounded");
_launched.remove(player);
if (_launched.contains(player)) System.out.println("CONCURRENT HASHMAP BROKE AND STILL HAS THE PLAYER IN IT!");
if (getGame().getMaze().isOnPad(player))
{
System.out.println("adding stat");
addStat(player);
}