geforkt von Mirrors/Paper
Fix Pathfinding After World Has Changed (#8068)
Dieser Commit ist enthalten in:
Ursprung
ad4ca0a429
Commit
72772baccf
@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
+public class PaperPathfinder implements com.destroystokyo.paper.entity.Pathfinder {
|
+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) {
|
+ public PaperPathfinder(net.minecraft.world.entity.Mob entity) {
|
||||||
+ this.entity = entity;
|
+ this.entity = entity;
|
||||||
@ -38,6 +38,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ return entity.getBukkitMob();
|
+ return entity.getBukkitMob();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+ public void setHandle(net.minecraft.world.entity.Mob entity) {
|
||||||
|
+ this.entity = entity;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public void stopPathfinding() {
|
+ public void stopPathfinding() {
|
||||||
+ entity.getNavigation().stop();
|
+ entity.getNavigation().stop();
|
||||||
@ -178,3 +182,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@Override
|
@Override
|
||||||
public void setTarget(LivingEntity target) {
|
public void setTarget(LivingEntity target) {
|
||||||
Preconditions.checkState(!this.getHandle().generation, "Cannot set target during world generation");
|
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";
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren