13
0
geforkt von Mirrors/Paper

Fix Pathfinding After World Has Changed (#8068)

Dieser Commit ist enthalten in:
tahmid-23 2022-09-19 21:39:46 -04:00
Ursprung ad4ca0a429
Commit 72772baccf

Datei anzeigen

@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+public class PaperPathfinder implements com.destroystokyo.paper.entity.Pathfinder {
+
+ private final net.minecraft.world.entity.Mob entity;
+ private net.minecraft.world.entity.Mob entity;
+
+ public PaperPathfinder(net.minecraft.world.entity.Mob entity) {
+ this.entity = entity;
@ -38,6 +38,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return entity.getBukkitMob();
+ }
+
+ public void setHandle(net.minecraft.world.entity.Mob entity) {
+ this.entity = entity;
+ }
+
+ @Override
+ public void stopPathfinding() {
+ entity.getNavigation().stop();
@ -178,3 +182,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public void setTarget(LivingEntity target) {
Preconditions.checkState(!this.getHandle().generation, "Cannot set target during world generation");
@@ -0,0 +0,0 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
return (net.minecraft.world.entity.Mob) entity;
}
+ // Paper start
+ @Override
+ public void setHandle(net.minecraft.world.entity.Entity entity) {
+ super.setHandle(entity);
+ paperPathfinder.setHandle(getHandle());
+ }
+ // Paper end
+
@Override
public String toString() {
return "CraftMob";