Merge branch 'ver/1.21.8' into ver/1.21.9

This commit is contained in:
granny
2025-09-23 22:12:38 -07:00
9 changed files with 80 additions and 58 deletions

View File

@@ -104,7 +104,7 @@
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + l, this.nextTickTimeNanos);
+ // Purpur start - Configurable TPS Catchup
+ if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup /*|| !gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup*/) { // Purpur - Configurable TPS Catchup
+ if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup) {
+ this.nextTickTimeNanos = currentTime + l;
+ this.delayedTasksMaxNextTickTimeNanos = nextTickTimeNanos;
+ }

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);
}
@@ -84,13 +84,11 @@
+ } else {
+ 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
+ else if (this.isLobotomized && shouldRestock()) restock();
+ // Purpur end - Lobotomize stuck villagers
profilerFiller.pop();
if (this.assignProfessionWhenSpawned) {
this.assignProfessionWhenSpawned = false;