From 7a1becf0716f0ab3a928adc4f2b3d75ed4205cb3 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 30 Aug 2024 19:56:03 +0700 Subject: [PATCH] Mark "refusing to add tickable" as debug line --- .../dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt | 2 ++ src/main/kotlin/ru/dbotthepony/mc/otm/core/util/TickList.kt | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt index df53e1acf..c7bf10448 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt @@ -39,6 +39,7 @@ import net.neoforged.neoforge.network.PacketDistributor import org.apache.logging.log4j.LogManager import ru.dbotthepony.mc.otm.network.DelegateSyncher import ru.dbotthepony.kommons.util.Listenable +import ru.dbotthepony.mc.otm.SERVER_IS_LIVE import ru.dbotthepony.mc.otm.block.INeighbourChangeListener import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.capability.MatteryCapability @@ -345,6 +346,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc get() = cache?.capability == null fun rebuildCache() { + if (!SERVER_IS_LIVE) return val level = level as? ServerLevel if (level == null) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/TickList.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/TickList.kt index ed53c1e2e..4b8c244ab 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/TickList.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/TickList.kt @@ -103,7 +103,7 @@ class TickList : ITickable { fun add(ticker: IConditionalTickable, condition: Boolean, reason: String) { if (!condition) { - LOGGER.error("Refusing to add tickable $ticker because we $reason", IllegalStateException(reason)) + LOGGER.debug("Refusing to add tickable $ticker because we $reason", IllegalStateException(reason)) return } @@ -116,7 +116,7 @@ class TickList : ITickable { fun once(ticker: ITickable, condition: Boolean, reason: String) { if (!condition) { - LOGGER.error("Refusing to add tickable $ticker because we $reason", IllegalStateException(reason)) + LOGGER.debug("Refusing to add tickable $ticker because we $reason", IllegalStateException(reason)) return } @@ -129,7 +129,7 @@ class TickList : ITickable { fun timer(timerTicks: Int, action: Runnable, condition: Boolean, reason: String): Timer? { if (!condition) { - LOGGER.error("Refusing to add timer $action in $timerTicks ticks because we $reason", IllegalStateException(reason)) + LOGGER.debug("Refusing to add timer $action in $timerTicks ticks because we $reason", IllegalStateException(reason)) return null }