@Override public void setActivate(boolean activate, boolean forceAdjust) { if (activate) { if (!activate() && (available() || forceAdjust)) { if (owner().distance(target()) < CAST_RANGE) { super.setActivate(true, forceAdjust); setTarget(owner().target()); setPosition(target().position().clone()); targetPreviousPosition = target().position().clone(); schedule(); setStartTime(Clocks.masterClock.currentTime()); Audio.playSound(Audio.BOUND_OF_FREEDOM); } } } else { clearTask(); super.setActivate(false, forceAdjust); } }
@Override protected void schedule() { setTimerID(Clocks.masterClock.scheduleFixedRate(this, UNIT_TIME, TimeUnit.MILLISECONDS)); Audio.playSound(Audio.SOUL_DIVE); }