player.setFallDistance(0.0f);
}
return;
}
AutoRefTeam team = apl.getTeam();
if (team == null) return;
// announce region (for cosmetic regions)
for (AutoRefRegion reg : team.getRegions())
if (reg.getName() != null && reg.isEnterEvent(event)) reg.announceRegion(apl);
double fallspeed = event.getFrom().getY() - event.getTo().getY();
Location exit = apl.getExitLocation();
// don't bother if the player isn't in survival mode
if (player.getGameMode() != GameMode.SURVIVAL
|| match.inStartRegion(event.getTo())) return;
// if a player leaves the start region...
if (!match.inStartRegion(event.getTo()))
{
if (match.getCurrentState().inProgress())
{
// if they are leaving the start region, clear everything
if (match.inStartRegion(event.getFrom()) && !apl.isActive()) apl.reset();
// one way or another, the player is now active
apl.setActive();
}
else if (match.getCurrentState().isBeforeMatch())
{ if (onGround) apl.die(null, false); return; }
}
// if they have left their region, mark their exit location
if (!team.canEnter(event.getTo(), 0.3) && !player.isSleeping())
{
// player is sneaking off the edge and not in freefall
if (player.isSneaking() && team.canEnter(event.getTo()) && fallspeed < FREEFALL_THRESHOLD);
// if there is no exit position, set the exit position
else if (exit == null) apl.setExitLocation(player.getLocation());
// if there is an exit position and they aren't falling, kill them