Class GroupRecipe.Context
-
- All Implemented Interfaces:
public final class GroupRecipe.ContextContext of GroupRecipe
Configure minimum amount in crafting and relation of item placements.
- Since:
5.0.15
-
-
Method Summary
Modifier and Type Method Description final Set<CoordinateComponent>getMembers()final IntegergetMin()final StringgetName()final static GroupRecipe.Contextof(Set<CoordinateComponent> members, Integer min, String name)Creates a Context with validations. final static GroupRecipe.Contextof(Set<CoordinateComponent> members, Integer min)Creates a Context with validations. final static GroupRecipe.Contextdefault(CoordinateComponent coordinate)Create default Context with specified coordinate. final static UnitisValidGroups(Set<GroupRecipe.Context> groups, Map<CoordinateComponent, CMatter> items)Validates the specified context set against the items mapping. -
-
Method Detail
-
getMembers
final Set<CoordinateComponent> getMembers()
-
of
@JvmOverloads() final static GroupRecipe.Context of(Set<CoordinateComponent> members, Integer min, String name)
Creates a Context with validations.
// Example val items = mapOf( CoordinateComponent(0, 0) to CMatterImpl.of(Material.STONE) ) val context = GroupRecipe.Context.of( members = items.keys, min = 1 ) // Context: // members: CoordinateComponent(0, 0) // min: 1 // name: <Random UUID>- Parameters:
members- Contained members.min- Minimum amount of item placementsname- Name of this context.- Returns:
GroupRecipe.Context GroupRecipe.Context
- Since:
5.0.15
-
of
@JvmOverloads() final static GroupRecipe.Context of(Set<CoordinateComponent> members, Integer min)
Creates a Context with validations.
// Example val items = mapOf( CoordinateComponent(0, 0) to CMatterImpl.of(Material.STONE) ) val context = GroupRecipe.Context.of( members = items.keys, min = 1 ) // Context: // members: CoordinateComponent(0, 0) // min: 1 // name: <Random UUID>- Parameters:
members- Contained members.min- Minimum amount of item placements- Returns:
GroupRecipe.Context GroupRecipe.Context
- Since:
5.0.15
-
default
final static GroupRecipe.Context default(CoordinateComponent coordinate)
Create default Context with specified coordinate.
val context = GroupRecipe.Context.default(CoordinateComponent(0, 0)) // Context // members: CoordinateComponent(0, 0) // min: 1 // name: <Random UUID>- Parameters:
coordinate- A coordinate in a recipe- Returns:
GroupRecipe.Context Context
- Since:
5.0.15
-
isValidGroups
final static Unit isValidGroups(Set<GroupRecipe.Context> groups, Map<CoordinateComponent, CMatter> items)
Validates the specified context set against the items mapping.
If those are invalid, throws an exception that includes error messages.
- Parameters:
groups- Set of GroupRecipe.Contextitems- Item mapping on GroupRecipe- Since:
5.0.15
-
-
-
-