@Override
public boolean update(Event event, ObjectiveProgress progress) {
if (event instanceof PlayerMoveEvent) {
PlayerMoveEvent ev = (PlayerMoveEvent) event;
Objective objective = progress.getObjective();
double leeway = objective.hasParameter("leeway") ? objective.getParameter("leeway").getDouble() : objective
.getAmount();
if (LocationUtils.withinRange(ev.getTo(), objective.getLocation(), leeway)
&& withinYawRange(ev.getTo(), objective)) {
if (!objective.hasParameter("time"))
return true;
return updateTime(objective.getParameter("time").getInt(), progress.getPlayer());
} else
reachTimes.remove(progress.getPlayer());
}
return false;
}