Fixed spawning mobs Error (Villager, etc..)
This commit is contained in:
parent
6e6e4d3fe0
commit
d6bf6ca0aa
|
@ -0,0 +1,55 @@
|
||||||
|
package net.minecraft.server;
|
||||||
|
|
||||||
|
public class PathfinderGoalRestrictOpenDoor extends PathfinderGoal {
|
||||||
|
private EntityCreature a;
|
||||||
|
private VillageDoor b;
|
||||||
|
|
||||||
|
public PathfinderGoalRestrictOpenDoor(EntityCreature var1) {
|
||||||
|
this.a = var1;
|
||||||
|
if (var1.getNavigation() == null) {
|
||||||
|
throw new IllegalArgumentException("Unsupported mob type for RestrictOpenDoorGoal");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean a() {
|
||||||
|
if (this.a.world.w()) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
BlockPosition var1 = new BlockPosition(this.a);
|
||||||
|
Village var2 = this.a.world.ae().getClosestVillage(var1, 16);
|
||||||
|
if (var2 == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
this.b = var2.b(var1);
|
||||||
|
if (this.b == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return (double)this.b.b(var1) < 2.25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean b() {
|
||||||
|
if (this.a.world.w()) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return !this.b.i() && this.b.c(new BlockPosition(this.a));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void c() {
|
||||||
|
(this.a.getNavigation()).b(false);
|
||||||
|
(this.a.getNavigation()).c(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void d() {
|
||||||
|
(this.a.getNavigation()).b(true);
|
||||||
|
(this.a.getNavigation()).c(true);
|
||||||
|
this.b = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void e() {
|
||||||
|
this.b.b();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue