Skip to content

Commit 9e90a83

Browse files
committed
missed this oops?
1 parent 80a033e commit 9e90a83

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

paper-api/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ default boolean moveTo(Location loc, double speed) {
113113
*
114114
* @param target the Entity to navigate to
115115
* @return If the pathfinding was successfully started
116+
*
117+
* @deprecated Use {@link #moveTo(Entity)} instead
116118
*/
119+
@Deprecated(forRemoval = true)
117120
default boolean moveTo(LivingEntity target) {
118121
return this.moveTo(target, 1);
119122
}
@@ -130,12 +133,49 @@ default boolean moveTo(LivingEntity target) {
130133
* @param target the Entity to navigate to
131134
* @param speed Speed multiplier to navigate at, where 1 is 'normal'
132135
* @return If the pathfinding was successfully started
136+
*
137+
* @deprecated Use {@link #moveTo(Entity, double)} instead.
133138
*/
139+
@Deprecated(forRemoval = true)
134140
default boolean moveTo(LivingEntity target, double speed) {
135141
PathResult path = this.findPath(target);
136142
return path != null && this.moveTo(path, speed);
137143
}
138144

145+
/**
146+
* Calculates a destination for the Entity to navigate to to reach the target entity,
147+
* and sets it with default speed.
148+
* <p>
149+
* The behavior of this PathResult is subject to the games pathfinding rules, and may
150+
* result in the pathfinding automatically updating to follow the target Entity.
151+
* <p>
152+
* However, this behavior is not guaranteed, and is subject to the game's behavior.
153+
*
154+
* @param target the Entity to navigate to
155+
* @return If the pathfinding was successfully started
156+
*/
157+
default boolean moveTo(Entity target) {
158+
return this.moveTo(target, 1);
159+
}
160+
161+
/**
162+
* Calculates a destination for the Entity to navigate to to reach the target entity,
163+
* and sets it with specified speed.
164+
* <p>
165+
* The behavior of this PathResult is subject to the games pathfinding rules, and may
166+
* result in the pathfinding automatically updating to follow the target Entity.
167+
* <p>
168+
* However, this behavior is not guaranteed, and is subject to the game's behavior.
169+
*
170+
* @param target the Entity to navigate to
171+
* @param speed Speed multiplier to navigate at, where 1 is 'normal'
172+
* @return If the pathfinding was successfully started
173+
*/
174+
default boolean moveTo(Entity target, double speed) {
175+
PathResult path = this.findPath(target);
176+
return path != null && this.moveTo(path, speed);
177+
}
178+
139179
/**
140180
* Takes the result of a previous pathfinding calculation and sets it
141181
* as the active pathfinding with default speed.

0 commit comments

Comments
 (0)