From d6bf6ca0aae440027cc5a2401b6a554eb48a2471 Mon Sep 17 00:00:00 2001 From: ImHacking Date: Fri, 24 Jun 2022 03:02:22 -0400 Subject: [PATCH] Fixed spawning mobs Error (Villager, etc..) --- .../PathfinderGoalRestrictOpenDoor.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 TacoSpigot-Server/src/main/java/net/minecraft/server/PathfinderGoalRestrictOpenDoor.java 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(); + } +}