From 40a3547595fd3590ef8ea0f06d8bd0e898cae037 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 15 May 2022 21:50:29 +0700 Subject: [PATCH] Fix storage bus crash on inventory shrink --- .../dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt index 25277c481..2189e13b6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt @@ -279,7 +279,8 @@ class StorageBusBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matter } else { // shrink for (i in parent.slots until scanned.size) { - removeTracked(i) + if (scannedMap[i] != null) + removeTracked(i) } scanned = arrayOfNulls(parent.slots)