fix(ridables): "only use brain if no rider" code was missing on some mobs

This commit is contained in:
granny
2025-09-18 18:10:28 -07:00
parent 59fb18d3c0
commit a49cdb9c75
8 changed files with 61 additions and 50 deletions

View File

@@ -9,14 +9,10 @@
i = 7;
} else if (randomSource.nextBoolean()) {
return false;
@@ -245,6 +_,11 @@
@@ -245,6 +_,7 @@
}
}
+ // Pufferfish start - only check for spooky season once an hour
+ //private static boolean isSpookySeason = false;
+ //private static final int ONE_HOUR = 20 * 60 * 60;
+ //private static int lastSpookyCheck = -ONE_HOUR;
+ public static boolean isHalloweenSeason(Level level) { return level.purpurConfig.forceHalloweenSeason || isHalloween(); } // Purpur - Halloween options and optimizations
private static boolean isHalloween() {
LocalDate localDate = LocalDate.now();

View File

@@ -67,7 +67,7 @@
@Override
public Brain<Villager> getBrain() {
return (Brain<Villager>)super.getBrain();
@@ -292,11 +_,24 @@
@@ -292,11 +_,22 @@
// Paper start - EAR 2
this.customServerAiStep(level, false);
}
@@ -85,12 +85,10 @@
+ this.isLobotomized = false;
+ }
+ // Purpur end - Lobotomize stuck villagers
+ // Pufferfish start
+ if (!inactive /*&& this.behaviorTick++ % this.activatedPriority == 0*/) {
+ if (!inactive) {
+ this.getBrain().tick(level, this); // Paper - EAR 2
+ }
+ else if (this.isLobotomized && shouldRestock()) restock(); // Purpur - Lobotomize stuck villagers
+ // Pufferfish end
profilerFiller.pop();
if (this.assignProfessionWhenSpawned) {
this.assignProfessionWhenSpawned = false;