forked from SteamWar/SteamWar
Improve AutoChecker and GameModeConfig again
This commit is contained in:
+4
-5
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user