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(