Class MatchGroup
-
- All Implemented Interfaces:
public final class MatchGroupA group of recipe slots (identified by their CoordinateComponent keys in CRecipe.items) that is satisfied as a whole rather than slot-by-slot.
Used by CRecipe.matchGroups to tell CRecipe.Type.SHAPELESS matching how many of members must actually be filled by an input item. A recipe slot whose coordinate is not covered by matching is simply never assigned an input; unlike GroupRecipe, no
Material.AIRplaceholder candidate is required to express "this slot may stay empty".- Since:
5.3.0
-
-
Method Summary
Modifier and Type Method Description final Set<CoordinateComponent>getMembers()final IntegergetMin()final IntegergetMax()final static MatchGroupof(Set<CoordinateComponent> members, Integer min, Integer max)Creates a MatchGroup with validation. final static MatchGroupmandatory(CoordinateComponent coordinate)Creates a MatchGroup that requires exactly one specific coordinate to be matched. -
-
Method Detail
-
getMembers
final Set<CoordinateComponent> getMembers()
-
of
final static MatchGroup of(Set<CoordinateComponent> members, Integer min, Integer max)
Creates a MatchGroup with validation.
- Parameters:
members- Coordinates belonging to this group.min- Minimum number of matched members.max- Maximum number of matched members.- Returns:
MatchGroup Created group.
- Since:
5.3.0
-
mandatory
final static MatchGroup mandatory(CoordinateComponent coordinate)
Creates a MatchGroup that requires exactly one specific coordinate to be matched.
Equivalent to
MatchGroup.of(setOf(coordinate), min = 1, max = 1). This is what CRecipe.matchGroups's default implementation uses for every recipe slot.- Parameters:
coordinate- The single coordinate this group covers.- Returns:
MatchGroup Created mandatory group.
- Since:
5.3.0
-
-
-
-