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;
@ -54,7 +54,7 @@ public class ZombieWrapper
{
_wrapper.setFireTicks(0);
}
public Location getLocation()
{
return _wrapper.getLocation().clone();
@ -109,12 +109,12 @@ public class ZombieWrapper
{
return _speed;
}
public void setTarget(Player target)
{
_wrapper.setTarget(target);
}
public Player getTarget()
{
return (Player) _wrapper.getTarget();