mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix villager brain ticks inconsistency with DAB
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable villager brain ticks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
index 682feb6f3c109b0b3034f3942f7dfa73721d359b..1d0263c594a41ef01d33ebfbd31d8dad0de1933f 100644
|
||||
index 682feb6f3c109b0b3034f3942f7dfa73721d359b..14b27c84624467615ad7cc4d5df94cd60fccb8f0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -141,6 +141,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -24,7 +24,7 @@ index 682feb6f3c109b0b3034f3942f7dfa73721d359b..1d0263c594a41ef01d33ebfbd31d8dad
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -274,6 +276,10 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -274,9 +276,13 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
protected void customServerAiStep() { mobTick(false); }
|
||||
protected void mobTick(boolean inactive) {
|
||||
this.level.getProfiler().push("villagerBrain");
|
||||
@@ -34,7 +34,11 @@ index 682feb6f3c109b0b3034f3942f7dfa73721d359b..1d0263c594a41ef01d33ebfbd31d8dad
|
||||
+ // Purpur end
|
||||
// Airplane start
|
||||
if (!inactive) {
|
||||
if (this.behaviorTick++ % this.activatedPriority == 0) // Airplane
|
||||
- if (this.behaviorTick++ % this.activatedPriority == 0) // Airplane
|
||||
+ if (level.purpurConfig.villagerBrainTicks != 1 || this.behaviorTick++ % this.activatedPriority == 0) // Airplane // Purpur
|
||||
this.getBrain().tick((ServerLevel) this.level, this);
|
||||
}
|
||||
// Airplane end
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index c4b95b8afd575ce94202b9359884a220e9c649a9..a4abc312a9c173fb6a4374c97012abc43c801b7a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
|
||||
Reference in New Issue
Block a user