30 lines
1.7 KiB
Diff
30 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: mrhua269 <mrhua269@gmail.com>
|
|
Date: Sat, 23 Aug 2025 19:19:21 +0800
|
|
Subject: [PATCH] Pufferfish: Throttle goal selector during inactive ticking
|
|
|
|
A part of Pufferfish(https://github.com/Pufferfish-gg/Pufferfish)
|
|
Co-authored-by: Kevin Raneri <kevin.raneri@gmail.com>
|
|
Original patch: https://github.com/pufferfish-gg/Pufferfish/blob/ver/1.21/pufferfish-server/minecraft-patches/features/0015-Throttle-goal-selector-during-inactive-ticking.patch
|
|
Original license(GPL-3.0): https://github.com/pufferfish-gg/Pufferfish/blob/ver/1.21/PATCH-LICENSE
|
|
|
|
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
|
index 0fec3165a3dbac92174111d9576a6d0124203940..b774f88bae7661f8d374b6f5aea49ae5c0f127c6 100644
|
|
--- a/net/minecraft/world/entity/Mob.java
|
|
+++ b/net/minecraft/world/entity/Mob.java
|
|
@@ -207,11 +207,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
return this.lookControl;
|
|
}
|
|
|
|
+ int _pufferfish_inactiveTickDisableCounter = 0; // Pufferfish - throttle inactive goal selector ticking
|
|
// Paper start
|
|
@Override
|
|
public void inactiveTick() {
|
|
super.inactiveTick();
|
|
- if (this.goalSelector.inactiveTick()) {
|
|
+ boolean isThrottled = me.earthme.luminol.config.modules.optimizations.EntityGoalSelectorInactiveTickConfig.enabled && _pufferfish_inactiveTickDisableCounter++ % 20 != 0; // Pufferfish - throttle inactive goal selector ticking
|
|
+ if (this.goalSelector.inactiveTick() && !isThrottled) { // Pufferfish
|
|
this.goalSelector.tick();
|
|
}
|
|
if (this.targetSelector.inactiveTick()) {
|