54 lines
2.4 KiB
Diff
54 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrHua269 <wangxyper@163.com>
|
|
Date: Wed, 31 Jul 2024 12:41:14 +0800
|
|
Subject: [PATCH] Petal Reduce sensor work
|
|
|
|
|
|
diff --git a/src/main/java/me/earthme/luminol/config/modules/optimizations/PetalReduceSensorWorkConfig.java b/src/main/java/me/earthme/luminol/config/modules/optimizations/PetalReduceSensorWorkConfig.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..dd45cf1fde5ee4cf8347064f106c64b861b77ead
|
|
--- /dev/null
|
|
+++ b/src/main/java/me/earthme/luminol/config/modules/optimizations/PetalReduceSensorWorkConfig.java
|
|
@@ -0,0 +1,22 @@
|
|
+package me.earthme.luminol.config.modules.optimizations;
|
|
+
|
|
+import me.earthme.luminol.config.ConfigInfo;
|
|
+import me.earthme.luminol.config.EnumConfigCategory;
|
|
+import me.earthme.luminol.config.IConfigModule;
|
|
+
|
|
+public class PetalReduceSensorWorkConfig implements IConfigModule {
|
|
+ @ConfigInfo(baseName = "enabled")
|
|
+ public static boolean enabled = true;
|
|
+ @ConfigInfo(baseName = "delay_ticks")
|
|
+ public static int delayTicks = 10;
|
|
+
|
|
+ @Override
|
|
+ public EnumConfigCategory getCategory() {
|
|
+ return EnumConfigCategory.OPTIMIZATIONS;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public String getBaseName() {
|
|
+ return "reduce_sensor_work";
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
index 1cb0029739a487d930e4f10371c82d3a03a46de4..a98d47cb24b2664a497863fc0676b2ef95a89ab2 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -940,12 +940,12 @@ 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 gameprofilerfiller = this.level().getProfiler();
|
|
|
|
gameprofilerfiller.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
|
|
gameprofilerfiller.pop();
|
|
- int i = this.tickCount + this.getId();
|
|
|
|
if (i % 2 != 0 && this.tickCount > 1) {
|
|
gameprofilerfiller.push("targetSelector");
|