Skip to content

Commit e0cc1c3

Browse files
committed
renamed attackMove to moveToAttacking
1 parent 1d75d28 commit e0cc1c3

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed

src/java/de/ntcomputer/minecraft/controllablemobs/api/ControllableMobActions.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,39 @@ public interface ControllableMobActions {
4343
* When the action's execution is started, all other movements caused by the AI are stopped and overridden.
4444
* If the entity has a target locked on, it will interrupt the movement, deal with this target, and then continue moving to the destination.
4545
*
46-
* @see #attackMoveTo(Location, boolean, double, double)
46+
* @see #moveToAttacking(Location, boolean, double, double)
4747
* @param loc the location the entity will move to.
4848
* @return {@link ControllableMobAction}
4949
*/
50-
public ControllableMobAction attackMoveTo(Location loc);
50+
public ControllableMobAction moveToAttacking(Location loc);
5151

5252
/**
5353
* Orders the entity to move to the given location, optionally adding the action to the queue.
5454
* This action is block accurate, meaning, that the entity will stop once it reached the block the given location is pointing at.
5555
* When the action's execution is started, all other movements caused by the AI are stopped and overridden.
5656
* If the entity has a target locked on, it will interrupt the movement, deal with this target, and then continue moving to the destination.
5757
*
58-
* @see #attackMoveTo(Location, boolean, double, double)
58+
* @see #moveToAttacking(Location, boolean, double, double)
5959
* @param loc the location the entity will move to.
6060
* @param queue whether this action should be added to the queue (true) or executed directly (false).
6161
* @return {@link ControllableMobAction}
6262
*/
63-
public ControllableMobAction attackMoveTo(Location loc, boolean queue);
63+
public ControllableMobAction moveToAttacking(Location loc, boolean queue);
6464

6565
/**
6666
* Orders the entity to move to the given location, optionally adding the action to the queue.
6767
* This action is block accurate, meaning, that the entity will stop once it reached the block the given location is pointing at.
6868
* When the action's execution is started, all other movements caused by the AI are stopped and overridden.
6969
* If the entity has a target locked on, it will interrupt the movement, deal with this target, and then continue moving to the destination.
7070
*
71-
* @see #attackMoveTo(Location, boolean, double, double)
71+
* @see #moveToAttacking(Location, boolean, double, double)
7272
* @param loc the location the entity will move to.
7373
* @param queue whether this action should be added to the queue (true) or executed directly (false).
7474
* @param maximumDistractionDistance the maximum distance this entity will try to follow targets in order to attack them. If reached, the entity will turn back and continue moving to the destination. Default is 16.0 blocks.
7575
* @return {@link ControllableMobAction}
7676
* @throws IllegalArgumentException when maximumDistractionDistance is zero or negative
7777
*/
78-
public ControllableMobAction attackMoveTo(Location loc, boolean queue, double maximumDistractionDistance) throws IllegalArgumentException;
78+
public ControllableMobAction moveToAttacking(Location loc, boolean queue, double maximumDistractionDistance) throws IllegalArgumentException;
7979

8080
/**
8181
* Orders the entity to move to the given location, optionally adding the action to the queue.
@@ -90,7 +90,7 @@ public interface ControllableMobActions {
9090
* @return {@link ControllableMobAction}
9191
* @throws IllegalArgumentException when maximumDistractionDistance or movementSpeedMultiplicator is zero or negative
9292
*/
93-
public ControllableMobAction attackMoveTo(Location loc, boolean queue, double maximumDistractionDistance, double movementSpeedMultiplicator) throws IllegalArgumentException;
93+
public ControllableMobAction moveToAttacking(Location loc, boolean queue, double maximumDistractionDistance, double movementSpeedMultiplicator) throws IllegalArgumentException;
9494

9595
/**
9696
* Orders the entity to look at the given location.

src/java/de/ntcomputer/minecraft/controllablemobs/api/actions/ActionType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public enum ActionType {
2424
/**
2525
* @see de.ntcomputer.minecraft.controllablemobs.api.ControllableMobActions#attackMoveTo(org.bukkit.Location, boolean, double, double)
2626
*/
27-
ATTACKMOVE(false, false),
27+
MOVEATTACKING(false, false),
2828

2929
/**
3030
* @see de.ntcomputer.minecraft.controllablemobs.api.ControllableMobActions#target(org.bukkit.entity.LivingEntity, boolean)

src/java/de/ntcomputer/minecraft/controllablemobs/implementation/CraftControllableMobActions.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import de.ntcomputer.minecraft.controllablemobs.api.ControllableMobActions;
88
import de.ntcomputer.minecraft.controllablemobs.api.actions.ActionType;
99
import de.ntcomputer.minecraft.controllablemobs.api.actions.ControllableMobAction;
10-
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionAttackMove;
10+
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionMoveAttacking;
1111
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionBase;
1212
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionCallback;
1313
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionDie;
@@ -180,25 +180,25 @@ public void setDefaultQueuingFlag(boolean defaultQueue) {
180180
}
181181

182182
@Override
183-
public ControllableMobAction attackMoveTo(Location loc) {
184-
return this.attackMoveTo(loc, defaultQueue);
183+
public ControllableMobAction moveToAttacking(Location loc) {
184+
return this.moveToAttacking(loc, defaultQueue);
185185
}
186186

187187
@Override
188-
public ControllableMobAction attackMoveTo(Location loc, boolean queue) {
189-
return this.attackMoveTo(loc, queue, 16.0D);
188+
public ControllableMobAction moveToAttacking(Location loc, boolean queue) {
189+
return this.moveToAttacking(loc, queue, 16.0D);
190190
}
191191

192192
@Override
193-
public ControllableMobAction attackMoveTo(Location loc, boolean queue, double maximumDistractionDistance) throws IllegalArgumentException {
194-
return this.attackMoveTo(loc, queue, maximumDistractionDistance, 1.0D);
193+
public ControllableMobAction moveToAttacking(Location loc, boolean queue, double maximumDistractionDistance) throws IllegalArgumentException {
194+
return this.moveToAttacking(loc, queue, maximumDistractionDistance, 1.0D);
195195
}
196196

197197
@Override
198-
public ControllableMobAction attackMoveTo(Location loc, boolean queue, double maximumDistractionDistance, double movementSpeedMultiplicator) throws IllegalArgumentException {
198+
public ControllableMobAction moveToAttacking(Location loc, boolean queue, double maximumDistractionDistance, double movementSpeedMultiplicator) throws IllegalArgumentException {
199199
if(maximumDistractionDistance <= 0) throw new IllegalArgumentException("maximumDistractionDistance must be greater than 0.0");
200200
if(movementSpeedMultiplicator <= 0) throw new IllegalArgumentException("movementSpeedMultiplicator must be greater than 0.0");
201-
return this.addAction(new ControllableMobActionAttackMove(this.actionManager, loc, movementSpeedMultiplicator, maximumDistractionDistance), queue);
201+
return this.addAction(new ControllableMobActionMoveAttacking(this.actionManager, loc, movementSpeedMultiplicator, maximumDistractionDistance), queue);
202202
}
203203

204204
}

src/java/de/ntcomputer/minecraft/controllablemobs/implementation/actions/ControllableMobActionMove.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import de.ntcomputer.minecraft.controllablemobs.api.actions.ActionType;
66

7-
public class ControllableMobActionMove extends ControllableMobActionAbstractMove {
7+
public class ControllableMobActionMove extends ControllableMobActionMoveAbstract {
88

99
public ControllableMobActionMove(ControllableMobActionManager manager, Location to, double movementSpeedMultiplicator) {
1010
super(manager, ActionType.MOVE, to, movementSpeedMultiplicator);

src/java/de/ntcomputer/minecraft/controllablemobs/implementation/actions/ControllableMobActionAbstractMove.java renamed to src/java/de/ntcomputer/minecraft/controllablemobs/implementation/actions/ControllableMobActionMoveAbstract.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
import de.ntcomputer.minecraft.controllablemobs.api.actions.ActionType;
99

10-
public class ControllableMobActionAbstractMove extends ControllableMobActionBase {
10+
public class ControllableMobActionMoveAbstract extends ControllableMobActionBase {
1111
public final int x;
1212
public final int y;
1313
public final int z;
1414
public final World world;
1515
public final double movementSpeedMultiplicator;
1616
private final boolean isValid;
1717

18-
public ControllableMobActionAbstractMove(ControllableMobActionManager manager, ActionType type, Location to, double movementSpeedMultiplicator) {
18+
public ControllableMobActionMoveAbstract(ControllableMobActionManager manager, ActionType type, Location to, double movementSpeedMultiplicator) {
1919
super(manager, type);
2020
if(to==null) {
2121
this.x = 0;

src/java/de/ntcomputer/minecraft/controllablemobs/implementation/actions/ControllableMobActionAttackMove.java renamed to src/java/de/ntcomputer/minecraft/controllablemobs/implementation/actions/ControllableMobActionMoveAttacking.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
import de.ntcomputer.minecraft.controllablemobs.api.actions.ActionType;
66

7-
public class ControllableMobActionAttackMove extends ControllableMobActionAbstractMove {
7+
public class ControllableMobActionMoveAttacking extends ControllableMobActionMoveAbstract {
88
public final double maxDistraction;
99
public double lastDistanceSquared = Double.MAX_VALUE;
1010

11-
public ControllableMobActionAttackMove(ControllableMobActionManager manager, Location to, double movementSpeedMultiplicator, double maxDistraction) {
12-
super(manager, ActionType.ATTACKMOVE, to, movementSpeedMultiplicator);
11+
public ControllableMobActionMoveAttacking(ControllableMobActionManager manager, Location to, double movementSpeedMultiplicator, double maxDistraction) {
12+
super(manager, ActionType.MOVEATTACKING, to, movementSpeedMultiplicator);
1313
if(this.isValid()) {
1414
this.maxDistraction = 0;
1515
} else {

src/java/de/ntcomputer/minecraft/controllablemobs/implementation/ai/AIGoalController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.bukkit.entity.LivingEntity;
44

55
import de.ntcomputer.minecraft.controllablemobs.implementation.CraftControllableMob;
6-
import de.ntcomputer.minecraft.controllablemobs.implementation.ai.behaviors.PathfinderGoalActionAttackMove;
6+
import de.ntcomputer.minecraft.controllablemobs.implementation.ai.behaviors.PathfinderGoalActionMoveAttacking;
77
import de.ntcomputer.minecraft.controllablemobs.implementation.ai.behaviors.PathfinderGoalActionFollow;
88
import de.ntcomputer.minecraft.controllablemobs.implementation.ai.behaviors.PathfinderGoalActionJump;
99
import de.ntcomputer.minecraft.controllablemobs.implementation.ai.behaviors.PathfinderGoalActionLook;
@@ -20,7 +20,7 @@ public AIGoalController(CraftControllableMob<E> mob) {
2020
@Override
2121
protected void createActionGoals() {
2222
this.addActionGoal(-3, new PathfinderGoalActionMove(mob));
23-
this.addActionGoal(-2, new PathfinderGoalActionAttackMove(mob));
23+
this.addActionGoal(-2, new PathfinderGoalActionMoveAttacking(mob));
2424
this.addActionGoal(-1, new PathfinderGoalActionFollow(mob));
2525
this.addActionGoal(0, new PathfinderGoalActionWait(mob));
2626
this.addActionGoal(Integer.MAX_VALUE, new PathfinderGoalActionJump(mob));

src/java/de/ntcomputer/minecraft/controllablemobs/implementation/ai/behaviors/PathfinderGoalActionMove.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import de.ntcomputer.minecraft.controllablemobs.implementation.CraftControllableMob;
55
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionMove;
66

7-
public class PathfinderGoalActionMove extends PathfinderGoalActionAbstractMove<ControllableMobActionMove> {
7+
public class PathfinderGoalActionMove extends PathfinderGoalActionMoveAbstract<ControllableMobActionMove> {
88

99
public PathfinderGoalActionMove(CraftControllableMob<?> mob) {
1010
super(mob, ActionType.MOVE);

src/java/de/ntcomputer/minecraft/controllablemobs/implementation/ai/behaviors/PathfinderGoalActionAbstractMove.java renamed to src/java/de/ntcomputer/minecraft/controllablemobs/implementation/ai/behaviors/PathfinderGoalActionMoveAbstract.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import net.minecraft.server.v1_6_R3.PathEntity;
44
import de.ntcomputer.minecraft.controllablemobs.api.actions.ActionType;
55
import de.ntcomputer.minecraft.controllablemobs.implementation.CraftControllableMob;
6-
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionAbstractMove;
6+
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionMoveAbstract;
77
import de.ntcomputer.minecraft.controllablemobs.implementation.nativeinterfaces.NativeInterfaces;
88

9-
public class PathfinderGoalActionAbstractMove<A extends ControllableMobActionAbstractMove> extends PathfinderGoalActionDelayed<A> {
9+
public class PathfinderGoalActionMoveAbstract<A extends ControllableMobActionMoveAbstract> extends PathfinderGoalActionDelayed<A> {
1010
private PathEntity path;
1111

12-
public PathfinderGoalActionAbstractMove(CraftControllableMob<?> mob, ActionType type) {
12+
public PathfinderGoalActionMoveAbstract(CraftControllableMob<?> mob, ActionType type) {
1313
super(mob, type);
1414
this.setMutexBits(3);
1515
}

src/java/de/ntcomputer/minecraft/controllablemobs/implementation/ai/behaviors/PathfinderGoalActionAttackMove.java renamed to src/java/de/ntcomputer/minecraft/controllablemobs/implementation/ai/behaviors/PathfinderGoalActionMoveAttacking.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import de.ntcomputer.minecraft.controllablemobs.api.actions.ActionType;
44
import de.ntcomputer.minecraft.controllablemobs.implementation.CraftControllableMob;
5-
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionAttackMove;
5+
import de.ntcomputer.minecraft.controllablemobs.implementation.actions.ControllableMobActionMoveAttacking;
66
import de.ntcomputer.minecraft.controllablemobs.implementation.nativeinterfaces.NativeInterfaces;
77

8-
public class PathfinderGoalActionAttackMove extends PathfinderGoalActionAbstractMove<ControllableMobActionAttackMove> {
8+
public class PathfinderGoalActionMoveAttacking extends PathfinderGoalActionMoveAbstract<ControllableMobActionMoveAttacking> {
99

10-
public PathfinderGoalActionAttackMove(CraftControllableMob<?> mob) {
11-
super(mob, ActionType.ATTACKMOVE);
10+
public PathfinderGoalActionMoveAttacking(CraftControllableMob<?> mob) {
11+
super(mob, ActionType.MOVEATTACKING);
1212
}
1313

1414
@Override

0 commit comments

Comments
 (0)