diff --git a/TacoSpigot-Server/src/main/java/net/minecraft/server/PathfinderGoalRestrictOpenDoor.java b/TacoSpigot-Server/src/main/java/net/minecraft/server/PathfinderGoalRestrictOpenDoor.java new file mode 100644 index 0000000..81108b1 --- /dev/null +++ b/TacoSpigot-Server/src/main/java/net/minecraft/server/PathfinderGoalRestrictOpenDoor.java @@ -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(); + } +}