Bug fixes
Shiroha CI / build (push) Canceled after 0s
Shiroha CI / Event File (push) Canceled after 0s

好罢有点多懒得总结了()
This commit is contained in:
2026-08-15 01:58:11 +08:00
parent f317990af4
commit 2734c91fca
6 changed files with 90 additions and 20 deletions
@@ -1,14 +1,33 @@
package io.nanachiyo0721.shiroha.config.modules.optimizations;
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import com.mojang.logging.LogUtils;
import io.nanachiyo0721.shiroha.config.IConfigModule;
import io.nanachiyo0721.shiroha.config.flags.ConfigClassInfo;
import io.nanachiyo0721.shiroha.config.flags.ConfigInfo;
import io.nanachiyo0721.shiroha.config.flags.DoNotLoad;
import io.nanachiyo0721.shiroha.enums.EnumConfigCategory;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import java.util.Set;
@ConfigClassInfo(category = EnumConfigCategory.OPTIMIZATIONS, name = "reduce_sensor_work", comments = "When it is enabled, it will delete the line of sight cache less often and use a faster nearby comparison.")
public class PetalReduceSensorWorkConfig implements IConfigModule {
@ConfigInfo(name = "enabled")
public static boolean enabled = true;
@ConfigInfo(name = "delay_ticks", comments = "The interval of each entity to drop the cache(in ticks)")
@ConfigInfo(name = "delay_ticks", comments = "The interval of each entity to drop the cache(in ticks (>0))")
public static int delayTicks = 10;
@DoNotLoad
private static final Logger LOGGER = LogUtils.getClassLogger();
@Override
public void onLoaded(CommentedFileConfig configInstance, @Nullable Set<Exception> e) {
if (delayTicks <= 0) {
LOGGER.info("Too small delay_ticks was set for reduce_sensor_work(expected > 0 but got {}), Clamping back to 1!", delayTicks);
delayTicks = 1;
}
}
}