Widen navigating definition

This commit is contained in:
fullwall 2022-11-07 23:30:39 +08:00
parent cda8aceb5d
commit 73689cf9c2
12 changed files with 12 additions and 13 deletions

View File

@ -306,9 +306,8 @@ public class WanderWaypointProvider
public void onSpawn(NPC npc) { public void onSpawn(NPC npc) {
this.npc = npc; this.npc = npc;
if (currentGoal == null) { if (currentGoal == null) {
currentGoal = WanderGoal.builder(npc).xrange(xrange).yrange(yrange).fallback(this).tree(this) currentGoal = WanderGoal.builder(npc).xrange(xrange).yrange(yrange).fallback(this).tree(this).delay(delay)
.worldguardRegion(getWorldGuardRegion()).build(); .worldguardRegion(getWorldGuardRegion()).build();
currentGoal.setDelay(delay);
} }
Iterator<GoalEntry> itr = npc.getDefaultGoalController().iterator(); Iterator<GoalEntry> itr = npc.getDefaultGoalController().iterator();
while (itr.hasNext()) { while (itr.hasNext()) {

View File

@ -290,7 +290,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
return; return;
} }
super.U(); super.U();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.a();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))

View File

@ -122,7 +122,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} }
Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity); Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity);
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.a();
updatePackets(navigating); updatePackets(navigating);
npc.update(); npc.update();

View File

@ -135,7 +135,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} }
Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity); Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity);
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.b();
updatePackets(navigating); updatePackets(navigating);
npc.update(); npc.update();

View File

@ -355,7 +355,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
return; return;
} }
W(); W();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.b();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))

View File

@ -359,7 +359,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
return; return;
} }
entityBaseTick(); entityBaseTick();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.b();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))

View File

@ -359,7 +359,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
return; return;
} }
entityBaseTick(); entityBaseTick();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.b();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))

View File

@ -389,7 +389,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
return; return;
} }
entityBaseTick(); entityBaseTick();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.b();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))

View File

@ -169,7 +169,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
return; return;
} }
super.baseTick(); super.baseTick();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.hasWanted();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))

View File

@ -170,7 +170,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
return; return;
} }
super.baseTick(); super.baseTick();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.hasWanted();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))

View File

@ -173,7 +173,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
return; return;
} }
super.baseTick(); super.baseTick();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.hasWanted();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))

View File

@ -291,7 +291,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} }
super.K(); super.K();
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating() || controllerMove.a();
if (!navigating && getBukkitEntity() != null if (!navigating && getBukkitEntity() != null
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity()) && (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))