EntityCreature scheduling priority for pathfinding can now be modified

This commit is contained in:
Felix Cravic 2020-11-27 10:47:35 +01:00
parent 8ae82a81a1
commit 80d899a53a

View File

@ -1,6 +1,7 @@
package net.minestom.server.entity;
import com.extollit.gaming.ai.path.HydrazinePathFinder;
import com.extollit.gaming.ai.path.SchedulingPriority;
import com.extollit.gaming.ai.path.model.IPath;
import net.minestom.server.attribute.Attributes;
import net.minestom.server.collision.CollisionUtils;
@ -406,6 +407,16 @@ public abstract class EntityCreature extends LivingEntity {
return pathPosition;
}
/**
* Changes the pathfinding priority for this entity.
*
* @param schedulingPriority the new scheduling priority
* @see <a href="https://github.com/MadMartian/hydrazine-path-finding#path-finding-scheduling">Scheduling Priority</a>
*/
public void setPathfindingPriority(@NotNull SchedulingPriority schedulingPriority) {
this.pathFinder.schedulingPriority(schedulingPriority);
}
/**
* Used to move the entity toward {@code direction} in the X and Z axis
* Gravity is still applied but the entity will not attempt to jump