diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/SynchronizedBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/SynchronizedBlockEntity.kt index fdafc67dc..89887290f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/SynchronizedBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/SynchronizedBlockEntity.kt @@ -25,13 +25,19 @@ import java.util.WeakHashMap abstract class SynchronizedBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(p_155228_, p_155229_, p_155230_) { val synchronizer = FieldSynchronizer { - if (!isRemoved && level?.isClientSide == false) { + if (!isRemoved && level?.isClientSide == false && (_subCache == null || (_subCache ?: throw ConcurrentModificationException()).players.isNotEmpty())) { onceServer { synchronizeToPlayers(true) } + } else { + markSynchronizerClean() } } + private fun markSynchronizerClean() { + synchronizer.markClean() + } + init { synchronizer.defaultEndpoint.markUnused() }