mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 14:59:22 +01:00
fixed a rare race condition (?) when iterating block entities
closes #329
This commit is contained in:
parent
1c9d5c1102
commit
41214e7b2f
1 changed files with 4 additions and 2 deletions
|
@ -67,9 +67,11 @@ public final class Helper {
|
|||
var chunk = Helper.getLoadedChunk(level, x, z);
|
||||
if (chunk != null) {
|
||||
for (var tilePos : chunk.getBlockEntitiesPos()) {
|
||||
if (tilePos.distSqr(pos) <= radius * radius)
|
||||
if (consumer.apply(chunk.getBlockEntity(tilePos)))
|
||||
if (tilePos.distSqr(pos) <= radius * radius) {
|
||||
var tile = chunk.getBlockEntity(tilePos);
|
||||
if (tile != null && consumer.apply(tile))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue