use of net.silentchaos512.gear.gear.trait.condition.OrTraitCondition in project Silent-Gear by SilentChaos512.
the class TraitBuilder method withGearTypeCondition.
public TraitBuilder withGearTypeCondition(GearType first, GearType... rest) {
if (rest.length > 0) {
Collection<GearType> types = new ArrayList<>(rest.length + 1);
types.add(first);
Collections.addAll(types, rest);
GearTypeTraitCondition[] values = types.stream().map(GearTypeTraitCondition::new).toArray(GearTypeTraitCondition[]::new);
return withConditions(new OrTraitCondition(values));
}
return withConditions(new GearTypeTraitCondition(first));
}
Aggregations