From bbba317c45408f2c78b727bcc3e1a4961b69c112 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 7 Oct 2022 18:19:27 +0700 Subject: [PATCH] Don't tick networking when no players are nearby --- .../dbotthepony/mc/otm/block/entity/SynchronizedBlockEntity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 66ef189a7..fdafc67dc 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 @@ -285,7 +285,7 @@ abstract class SynchronizedBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: if (ref == null) { listIterator.remove() - } else { + } else if (ref.players.isNotEmpty()) { var hitObservers = false val blockIterator = ref.observingBlockEntities.listIterator()