mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-28 19:39:17 +00:00
optimize no action time
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.dreeam.leaf.config.modules.opt;
|
||||
|
||||
import org.dreeam.leaf.config.ConfigModules;
|
||||
import org.dreeam.leaf.config.EnumConfigCategory;
|
||||
import org.dreeam.leaf.config.annotations.Experimental;
|
||||
|
||||
public class OptimizeNoActionTime extends ConfigModules {
|
||||
public String getBasePath() {
|
||||
return EnumConfigCategory.PERF.getBaseKeyName() + ".optimize-no-action-time";
|
||||
}
|
||||
|
||||
@Experimental
|
||||
public static boolean disableLightCheck = false;
|
||||
|
||||
@Override
|
||||
public void onLoaded() {
|
||||
disableLightCheck = config.getBoolean(getBasePath() + ".disable-light-check", disableLightCheck);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user