use of com.lowdragmc.multiblocked.api.pattern.predicates.SimplePredicate in project Multiblocked by Low-Drag-MC.
the class TraceabilityPredicate method setMinGlobalLimited.
/**
* Set the minimum number of candidate blocks.
*/
public TraceabilityPredicate setMinGlobalLimited(int min) {
limited.addAll(common);
common.clear();
for (SimplePredicate predicate : limited) {
predicate.minCount = min;
}
return this;
}
use of com.lowdragmc.multiblocked.api.pattern.predicates.SimplePredicate in project Multiblocked by Low-Drag-MC.
the class TraceabilityPredicate method test.
public boolean test(MultiblockState blockWorldState) {
blockWorldState.io = IO.BOTH;
boolean flag = false;
for (SimplePredicate predicate : limited) {
if (predicate.testLimited(blockWorldState)) {
flag = true;
}
}
return flag || common.stream().anyMatch(predicate -> predicate.test(blockWorldState));
}
use of com.lowdragmc.multiblocked.api.pattern.predicates.SimplePredicate in project Multiblocked by Low-Drag-MC.
the class PatternError method getCandidates.
public List<List<ItemStack>> getCandidates() {
TraceabilityPredicate predicate = worldState.predicate;
List<List<ItemStack>> candidates = new ArrayList<>();
for (SimplePredicate common : predicate.common) {
candidates.add(common.getCandidates());
}
for (SimplePredicate limited : predicate.limited) {
candidates.add(limited.getCandidates());
}
return candidates;
}
Aggregations