9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-22 16:39:22 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0265-optimize-no-action-time.patch

24 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: hayanesuru <hayanesuru@outlook.jp>
Date: Fri, 4 Jul 2025 03:06:55 +0900
Subject: [PATCH] optimize no action time
diff --git a/net/minecraft/world/entity/monster/Monster.java b/net/minecraft/world/entity/monster/Monster.java
index 04d5910d736dee2a88a2602f4a98495459277157..22fd0fe972a732aae409f0a0ab2aa5756a9b06ce 100644
--- a/net/minecraft/world/entity/monster/Monster.java
+++ b/net/minecraft/world/entity/monster/Monster.java
@@ -46,6 +46,12 @@ public abstract class Monster extends PathfinderMob implements Enemy {
}
protected void updateNoActionTime() {
+ // Leaf start - optimize no action time
+ if (org.dreeam.leaf.config.modules.opt.OptimizeNoActionTime.disableLightCheck) {
+ this.noActionTime++;
+ return;
+ }
+ // Leaf end - optimize no action time
float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue();
if (lightLevelDependentMagicValue > 0.5F) {
this.noActionTime += 2;