mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 08:39:11 +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.
|
||||
*/
|
||||
public T getMob() {
|
||||
public final T getMob() {
|
||||
return mob;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,12 +54,11 @@ public abstract class DistancedAction<T extends Mob> extends Action<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (reached) {
|
||||
// some actions (e.g. agility) will cause the player to move away again
|
||||
// so we don't check once the player got close enough once
|
||||
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.
|
||||
public final void execute() {
|
||||
if (reached) { // Don't check again in case the player has moved away since it was reached
|
||||
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.
|
||||
} else if (mob.getPosition().getDistance(position) <= distance && mob.getWalkingQueue().size() == 0) {
|
||||
reached = true;
|
||||
setDelay(delay);
|
||||
|
||||
@@ -65,7 +65,7 @@ public abstract class ScheduledTask {
|
||||
* @param delay The delay.
|
||||
* @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) {
|
||||
throw new IllegalArgumentException("Delay cannot be less than 0.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user