forked from SteamWar/SteamWar
Continue
This commit is contained in:
+7
@@ -30,6 +30,7 @@ import lombok.ToString;
|
||||
import org.bukkit.Material;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class AutoChecker {
|
||||
|
||||
@@ -65,5 +66,11 @@ public class AutoChecker {
|
||||
private final Map<Material, List<BlockPos>> designBlocks = new EnumMap<>(Material.class);
|
||||
private final Map<BlockPos, InventoryScanResult> inventoryScans = new HashMap<>();
|
||||
private final Map<BlockPos, Set<Material>> forbiddenNbt = new HashMap<>();
|
||||
|
||||
public Map<Material, Integer> getItemCounts() {
|
||||
return inventoryScans.values().stream()
|
||||
.flatMap(i -> i.getItemCounts().entrySet().stream())
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, Integer::sum));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -62,10 +62,12 @@ public class AutoCheckerResult {
|
||||
!type.isAfterDeadline();
|
||||
}
|
||||
|
||||
public boolean isDispenserItemsOK() {
|
||||
return blockScanResult.getDispenserItems().values().stream().allMatch(i -> i <= type.Schematic.MaxDispenserItems);
|
||||
|
||||
public boolean doInventoriesOnlyContainAllowedItems() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean hasWarnings() {
|
||||
return blockScanResult.getDefunctNbt().isEmpty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user