mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix #113 - Lobotomized villagers wont restock
This commit is contained in:
@@ -18,10 +18,10 @@ index 13227c558b..330ac6cf85 100644
|
||||
public float yaw;
|
||||
public float pitch;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index 823155821b..d882c1136a 100644
|
||||
index 823155821b..5d25c42d52 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -187,11 +187,23 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@@ -187,15 +187,28 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
@@ -45,6 +45,19 @@ index 823155821b..d882c1136a 100644
|
||||
boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick)
|
||||
// Purpur end
|
||||
if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
|
||||
+ else checkRestock(); // Purpur
|
||||
this.world.getMethodProfiler().exit();
|
||||
if (this.bF) {
|
||||
this.bF = false;
|
||||
@@ -361,6 +374,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
return this.bD == 0 || this.bD < 2 && this.world.getTime() > this.bC + 2400L;
|
||||
}
|
||||
|
||||
+ public boolean checkRestock() { return fc(); } // Purpur - OBFHELPER
|
||||
public boolean fc() {
|
||||
long i = this.bC + 12000L;
|
||||
long j = this.world.getTime();
|
||||
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
index b92ca4a6de..1208464fba 100644
|
||||
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
|
||||
@@ -133,7 +133,7 @@ index 2d91869660..e376306bc2 100644
|
||||
} else {
|
||||
object = new BehaviorWork();
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index d882c1136a..61b95d54c5 100644
|
||||
index 5d25c42d52..6225101c63 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -131,7 +131,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@@ -145,7 +145,7 @@ index d882c1136a..61b95d54c5 100644
|
||||
}
|
||||
|
||||
behaviorcontroller.a(Activity.CORE, Behaviors.a(villagerprofession, 0.5F));
|
||||
@@ -833,6 +833,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@@ -835,6 +835,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@Override
|
||||
public boolean i(ItemStack itemstack) {
|
||||
Item item = itemstack.getItem();
|
||||
@@ -157,7 +157,7 @@ index d882c1136a..61b95d54c5 100644
|
||||
|
||||
return (EntityVillager.bs.contains(item) || this.getVillagerData().getProfession().c().contains(item)) && this.getInventory().b(itemstack);
|
||||
}
|
||||
@@ -854,6 +859,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@@ -856,6 +861,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
}
|
||||
|
||||
public boolean canPlant() {
|
||||
|
||||
Reference in New Issue
Block a user