Add shouldDie method, update zombie wrapper name

This commit is contained in:
Thanos Paravantis 2016-06-28 20:38:32 +03:00
parent 43f375fd86
commit 5e9f16424c
2 changed files with 15 additions and 9 deletions

View File

@ -107,7 +107,6 @@ public abstract class Challenge implements Listener
*/
public void onStart()
{
}
/**
@ -115,7 +114,11 @@ public abstract class Challenge implements Listener
*/
public void onEnd()
{
}
protected boolean shouldDie(Player player)
{
return true;
}
public void start()
@ -230,11 +233,14 @@ public abstract class Challenge implements Listener
Player player = event.getEntity();
Location death = player.getLocation().clone();
Data.addLostPlayer(player);
if (shouldDie(player))
{
Location death = player.getLocation().clone();
Data.addLostPlayer(player);
Host.getDeathEffect().playDeath(player, death);
handleDeath(player);
Host.getDeathEffect().playDeath(player, death);
handleDeath(player);
}
}
private void handleDeath(Player player)

View File

@ -38,7 +38,7 @@ public class ZombieWrapper
UtilEnt.Vegetate(_wrapper);
UtilEnt.ghost(_wrapper, true, false);
_wrapper.setCustomName(C.Bold + C.cRed + "Infected Zombie");
_wrapper.setCustomName(C.cRedB + "Infected Zombie");
_wrapper.setCustomNameVisible(true);
return _wrapper;