Sneaky assassin power-up maximum is 5 and hanging entities cannot be damaged

This commit is contained in:
CoderTim 2014-08-06 21:35:11 -04:00
parent c647e6b48d
commit f7f9d3e703
2 changed files with 12 additions and 8 deletions

View File

@ -294,6 +294,13 @@ public class SneakyAssassins extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(ignoreCancelled = true)
public void onDamageHanging(EntityDamageEvent event)
{
if (event.getEntity() instanceof Hanging)
event.setCancelled(true);
}
@EventHandler(ignoreCancelled = true) @EventHandler(ignoreCancelled = true)
public void onWitherEffectDamager(CustomDamageEvent event) public void onWitherEffectDamager(CustomDamageEvent event)
{ {

View File

@ -174,19 +174,16 @@ public class PowerUpManager implements Listener
UtilPlayer.message(event.getPlayer(), F.main("Game", "You now have a " + F.item("Compass") + " for tracking players")); UtilPlayer.message(event.getPlayer(), F.main("Game", "You now have a " + F.item("Compass") + " for tracking players"));
getGame().Announce(F.main("Game", F.name(C.Bold + event.getPlayer().getName()) + " has become a " + F.skill(C.Bold + "Master Assassin"))); getGame().Announce(F.main("Game", F.name(C.Bold + event.getPlayer().getName()) + " has become a " + F.skill(C.Bold + "Master Assassin")));
for (Player player : UtilServer.getPlayers()) for (Player player : UtilServer.getPlayers())
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f); player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 1f, 1f);
} }
else else if (count < 5)
{ {
if (count < 5) PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom());
{ PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom());
PowerUpType.WEAPON.powerUpPlayer(event.getPlayer(), getRandom());
PowerUpType.ARMOR.powerUpPlayer(event.getPlayer(), getRandom());
UtilPlayer.message(event.getPlayer(), F.main("Game", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded!")); UtilPlayer.message(event.getPlayer(), F.main("Game", "Your " + F.item("Sword") + " and " + F.item("Armor") + " have been upgraded!"));
}
getGame().Announce(F.main("Game", F.name(event.getPlayer().getName()) + " collected a " + F.skill("Powerup") + ".")); getGame().Announce(F.main("Game", F.name(event.getPlayer().getName()) + " collected a " + F.skill("Powerup") + "."));
} }