Skip to content

Commit 53c300a

Browse files
committed
only try replacement once, in case chunks suddenly vanish, get unloaded, ...
1 parent 780277b commit 53c300a

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/main/java/de/dafuqs/lootcrates/worldgen/LootCratesWorldgenReplacer.java

-7
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ public static void tick(MinecraftServer server) {
281281

282282
// Some protection against concurrent modifications
283283
List<LootCrateReplacementPosition> list = new ArrayList<>(replacements);
284-
List<LootCrateReplacementPosition> tryAgainList = new ArrayList<>();
285284
replacements.clear();
286285

287286
for (LootCrateReplacementPosition replacementPosition : list) {
@@ -293,7 +292,6 @@ public static void tick(MinecraftServer server) {
293292
blockEntity = serverWorld.getBlockEntity(replacementPosition.blockPos);
294293
} catch (Exception e) {
295294
LootCrates.LOGGER.error("[LootCrates] Error while replacing a container with loot table '" + replacementPosition.lootTable + "' in the world '" + replacementPosition.worldKey + "' at '" + replacementPosition.blockPos + "' ) + " + e.getLocalizedMessage());
296-
tryAgainList.add(replacementPosition);
297295
continue;
298296
}
299297
if(blockEntity != null && !(blockEntity instanceof LootCrateBlockEntity)) {
@@ -344,16 +342,11 @@ public static void tick(MinecraftServer server) {
344342
}
345343
}
346344
}
347-
} else {
348-
tryAgainList.add(replacementPosition);
349345
}
350346
} catch (Exception e) {
351347
LootCrates.LOGGER.error("[LootCrates] Error while replacing a container with loot table '" + replacementPosition.lootTable + "' in the world '" + replacementPosition.worldKey + "' at '" + replacementPosition.blockPos + "') + " + e.getLocalizedMessage());
352-
tryAgainList.add(replacementPosition);
353348
}
354349
}
355-
356-
replacements = tryAgainList;
357350
}
358351
}
359352

0 commit comments

Comments
 (0)