Target the blockbreaker block directly and adjust pathDistanceMargin to get close enough to it

This commit is contained in:
fullwall 2022-06-22 12:18:06 +08:00
parent d0366bccde
commit 1ca256753b

View File

@ -76,8 +76,10 @@ public abstract class AbstractBlockBreaker extends BlockBreaker {
if (entity instanceof NPCHolder) {
NPC npc = ((NPCHolder) entity).getNPC();
if (npc != null && !npc.getNavigator().isNavigating()) {
npc.getNavigator().setTarget(location.clone().add(0, 1, 0));
npc.getNavigator().getLocalParameters().distanceMargin(Math.max(configuration.radius() - 1, 0.5));
npc.getNavigator().setTarget(location);
npc.getNavigator().getLocalParameters().pathDistanceMargin(
Math.max(1, npc.getNavigator().getLocalParameters().pathDistanceMargin()));
npc.getNavigator().getLocalParameters().distanceMargin(Math.max(configuration.radius() - 1, 0.75));
setTarget = true;
}
}