Various improvements.

This commit is contained in:
Mysticate 2015-07-25 23:44:55 -04:00
parent 0fd59e9fdb
commit 4ceb156e69
2 changed files with 18 additions and 4 deletions

View File

@ -108,6 +108,8 @@ public class BombLobbers extends TeamGame implements IThrown
HungerSet = 20;
WorldTimeSet = -1;
registerStatTrackers(new Tracker6Kill(this), new TrackerBlastProof(this), new TrackerNoDamage(this), new TrackerTNTThrown(this), new TrackerDirectHit(this));
}
@ -294,6 +296,8 @@ public class BombLobbers extends TeamGame implements IThrown
if (!IsLive())
return;
NautHashMap<TNTPrimed, BombToken> toAdd = new NautHashMap<TNTPrimed, BombToken>();
Iterator<Entry<TNTPrimed, BombToken>> iterator = _tnt.entrySet().iterator();
while (iterator.hasNext())
{
@ -329,10 +333,16 @@ public class BombLobbers extends TeamGame implements IThrown
tnt.getKey().remove();
iterator.remove();
_tnt.put(newTNT, token);
toAdd.put(newTNT, token);
}
}
}
//Prevent concurrent modification thigns
for (Entry<TNTPrimed, BombToken> entry : toAdd.entrySet())
{
_tnt.put(entry.getKey(), entry.getValue());
}
}
@EventHandler
@ -442,13 +452,13 @@ public class BombLobbers extends TeamGame implements IThrown
if (team.GetColor() == ChatColor.AQUA)
{
for (int i = 0 ; i < 5 ; i++)
for (int i = 0 ; i < 2 ; i++)
UtilParticle.PlayParticle(ParticleType.RED_DUST, newTarget.clone().add(0.0, 0.5, 0.0), -1, 1, 1, 1, 0,
ViewDist.NORMAL, UtilServer.getPlayers());
}
else
{
for (int i = 0 ; i < 5 ; i++)
for (int i = 0 ; i < 2 ; i++)
UtilParticle.PlayParticle(ParticleType.RED_DUST, newTarget.clone().add(0.0, 0.5, 0.0), 0, 0, 0, 0, 1,
ViewDist.NORMAL, UtilServer.getPlayers());
}

View File

@ -6,6 +6,7 @@ import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
public class TrackerDirectHit extends StatTracker<Game>
{
@ -14,7 +15,7 @@ public class TrackerDirectHit extends StatTracker<Game>
super(game);
}
@EventHandler
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onKillDirectHit(CustomDamageEvent event)
{
if (!getGame().IsLive())
@ -28,6 +29,9 @@ public class TrackerDirectHit extends StatTracker<Game>
if (!getGame().IsAlive(damager))
return;
if (event.GetReason() == null)
return;
if (event.GetReason().toLowerCase().contains("direct hit"))
addStat(damager, "Direct Hit", 1, false, false);
}