mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 08:40:03 +00:00
Make specific action-related methods final.
This commit is contained in:
@@ -41,7 +41,7 @@ public abstract class Action<T extends Mob> extends ScheduledTask {
|
|||||||
*
|
*
|
||||||
* @return The mob.
|
* @return The mob.
|
||||||
*/
|
*/
|
||||||
public T getMob() {
|
public final T getMob() {
|
||||||
return mob;
|
return mob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,12 +54,11 @@ public abstract class DistancedAction<T extends Mob> extends Action<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public final void execute() {
|
||||||
if (reached) {
|
if (reached) { // Don't check again in case the player has moved away since it was reached
|
||||||
// some actions (e.g. agility) will cause the player to move away again
|
executeAction();
|
||||||
// so we don't check once the player got close enough once
|
// TODO checking the walking queue size is a really cheap fix, and relies on the client not
|
||||||
executeAction(); // TODO checking the walking queue size is a really cheap fix, and relies on the client not
|
// being edited... this class needs to be completely re-written.
|
||||||
// being edited... this class needs to be completely re-written.
|
|
||||||
} else if (mob.getPosition().getDistance(position) <= distance && mob.getWalkingQueue().size() == 0) {
|
} else if (mob.getPosition().getDistance(position) <= distance && mob.getWalkingQueue().size() == 0) {
|
||||||
reached = true;
|
reached = true;
|
||||||
setDelay(delay);
|
setDelay(delay);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public abstract class ScheduledTask {
|
|||||||
* @param delay The delay.
|
* @param delay The delay.
|
||||||
* @throws IllegalArgumentException If the delay is less than or equal to zero.
|
* @throws IllegalArgumentException If the delay is less than or equal to zero.
|
||||||
*/
|
*/
|
||||||
public void setDelay(int delay) {
|
public final void setDelay(int delay) {
|
||||||
if (delay < 0) {
|
if (delay < 0) {
|
||||||
throw new IllegalArgumentException("Delay cannot be less than 0.");
|
throw new IllegalArgumentException("Delay cannot be less than 0.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user