From 20c58c578d8567374e872f1d8740cef779225aad Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 29 Mar 2025 21:08:54 +0700 Subject: [PATCH] okey --- .../dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 4a4d90f37..ac5458346 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 @@ -358,6 +358,9 @@ abstract class MatteryBlockEntity(type: BlockEntityType<*>, pos: BlockPos, state } override fun get(): T? { + if (isRemoved) + return null + return cache?.capability } @@ -371,13 +374,13 @@ abstract class MatteryBlockEntity(type: BlockEntityType<*>, pos: BlockPos, state if (!SERVER_IS_LIVE) return val level = level as? ServerLevel + val creationVersion = ++currentVersion + if (level == null) { cache = null return } - val creationVersion = ++currentVersion - val direction = blockRotation.side2Dir(side) cache = BlockCapabilityCache.create(