From 9577e205e7bfb706e7b2b77a7d6faa70130e0844 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 25 Mar 2025 11:52:01 +0700 Subject: [PATCH] Set last returned index to -1 when removing --- .../kotlin/ru/dbotthepony/mc/otm/core/collect/BlockPosSet.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/collect/BlockPosSet.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/collect/BlockPosSet.kt index 24a60b14c..129e77d32 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/collect/BlockPosSet.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/collect/BlockPosSet.kt @@ -71,6 +71,7 @@ class BlockPosSet : MutableSet { throw NoSuchElementException() bits[last] = false + last = -1 } } } @@ -157,6 +158,7 @@ class BlockPosSet : MutableSet { override fun next(): BlockPos { findNext() last = current + foundNext = false val blockPos = current.next() return blockPos }