Improve AutoChecker and GameModeConfig again

This commit is contained in:
2026-08-26 21:46:45 +02:00
parent 5a52771ec1
commit 38e845b0e4
7 changed files with 187 additions and 130 deletions
@@ -200,11 +200,10 @@ public class SchematicCommand extends SWCommand {
for (Map.Entry<BlockPos, Map<Material, Integer>> posEntry : result.getBlockScanResult().getInventoryItemCounts().entrySet()) {
BlockPos pos = posEntry.getKey();
Material inventory = result.getBlockScanResult().getInventoryBlockType().get(pos);
Map<Material, Integer> caps = type.Schematic.ItemsInInventory.getOrDefault(inventory, Collections.emptyMap());
for (Map.Entry<Material, Integer> itemEntry : posEntry.getValue().entrySet()) {
Material itemType = itemEntry.getKey();
int cap = caps.getOrDefault(itemType, Integer.MAX_VALUE);
Integer cap = type.Schematic.getItemAmount(inventory, itemType);
if (itemEntry.getValue() <= cap) {
continue;
}
@@ -243,9 +242,9 @@ public class SchematicCommand extends SWCommand {
}
if (!result.isLimitedBlocksOK()) {
Set<Material> toReplace = type.Schematic.Limited.entrySet().stream()
.filter(setIntegerEntry -> setIntegerEntry.getValue() == 0)
.flatMap(setIntegerEntry -> setIntegerEntry.getKey().stream())
Set<Material> toReplace = type.Schematic.Limited.stream()
.filter(rule -> rule.MaxCount == 0)
.flatMap(rule -> rule.Blocks.stream())
.collect(Collectors.toSet());
BlockState replaceType = Objects.requireNonNull(toReplace.contains(Material.END_STONE) ? BlockTypes.IRON_BLOCK : BlockTypes.END_STONE).getDefaultState();
BlockVector3 min = clipboard.getMinimumPoint();