Skip to content

Instantly share code, notes, and snippets.

@aikar
Created September 9, 2018 15:32
Show Gist options
  • Save aikar/7f1ceb079d3bfbd5557a8d2cf8c4d9e6 to your computer and use it in GitHub Desktop.
Save aikar/7f1ceb079d3bfbd5557a8d2cf8c4d9e6 to your computer and use it in GitHub Desktop.
package com.destroystokyo.paper.entity;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Mob;
import java.util.List;
public interface Pathfinder <T extends Mob> {
/**
*
* @return The entity that is controlled by this pathfinder
*/
T getEntity();
boolean hasDestination();
Location getCurrentDestination();
Location calculateDestination(Location loc);
Location calculateDestination(LivingEntity target);
default boolean setDestination(Location loc) {
return setDestination(loc, 1);
}
boolean setDestination(Location loc, double speed);
default boolean setDestination(LivingEntity target) {
return setDestination(target, 1);
}
boolean setDestination(LivingEntity target, double speed);
List<Location> getPathPoints();
Integer getCurrentPointIndex();
Location getNextPathPoint();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment