Files
LuminolMC/luminol-server/minecraft-patches/features/0038-Petal-Reduce-sensor-work.patch
Helvetica Volubi d8a01345c6 Start 1.21.6
2025-06-23 00:13:00 +08:00

28 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Sun, 12 Jan 2025 12:21:59 +0800
Subject: [PATCH] Petal: Reduce sensor work
Co-authored by: peaches94 <peachescu94@gmail.com>
As part of: Petal (https://github.com/Bloom-host/Petal/blob/cc691540fb48240f38b376f3d94c8b0db2b60d99/patches/server/0005-feat-reduce-sensor-work.patch)
Licensed under: GPL-3.0 (https://github.com/Bloom-host/Petal/blob/cc691540fb48240f38b376f3d94c8b0db2b60d99/LICENSE)
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
index d9ee3b56db44687cfcc6a75f44a1abbcc8ef95a9..4c1442410f18b2ebafdb4c4d480f0f59ef656492 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
@@ -753,11 +753,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
return;
}
// Paper end - Allow nerfed mobs to jump and float
+ int i = this.tickCount + this.getId(); //Luminol - Petal - Move up
ProfilerFiller profilerFiller = Profiler.get();
profilerFiller.push("sensing");
- this.sensing.tick();
+ if (i % me.earthme.luminol.config.modules.optimizations.PetalReduceSensorWorkConfig.delayTicks == 0 || !me.earthme.luminol.config.modules.optimizations.PetalReduceSensorWorkConfig.enabled) this.sensing.tick(); // Luminol - Petal - Reduce sensor work
profilerFiller.pop();
- int i = this.tickCount + this.getId();
if (i % 2 != 0 && this.tickCount > 1) {
profilerFiller.push("targetSelector");
this.targetSelector.tickRunningGoals(false);