Class CVanillaRecipe
-
- All Implemented Interfaces:
-
io.github.sakaki_aruka.customcrafter.recipe.CRecipe
public final class CVanillaRecipe implements CRecipe
A CRecipe wrapper for vanilla Recipe instances. For internal use only; instantiation is restricted to internal code.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate final Map<CoordinateComponent, CMatter>itemsprivate final CRecipe.Typetypeprivate final List<CRecipePredicate>predicatesprivate final List<ResultSupplier>resultsprivate final Recipeoriginal
-
Method Summary
Modifier and Type Method Description StringgetName()Name of this recipe. Map<CoordinateComponent, CMatter>getItems()Mapping of CMatter to their coordinates on the crafting slots. CRecipe.TypegetType()Type of this recipe. List<CRecipePredicate>getPredicates()List of CRecipePredicate that run during recipe matching. List<ResultSupplier>getResults()List of ResultSupplier that provide items to players. final RecipegetOriginal()final MappedRelationrelateWith(CraftView view)Builds a MappedRelation by matching this recipe's slots against the given view in index order. final static CVanillaRecipefromVanilla(CraftingRecipe recipe)Converts a vanilla CraftingRecipe to a CVanillaRecipe. final static CVanillaRecipefromShaped(ShapedRecipe recipe)Converts a vanilla shaped recipe to a CRecipe. final static CVanillaRecipefromShapeless(ShapelessRecipe recipe)Converts a vanilla shapeless recipe to a CRecipe. final static CVanillaRecipefromTransmute(TransmuteRecipe recipe)Converts a vanilla transmute recipe to a CRecipe. -
Methods inherited from class io.github.sakaki_aruka.customcrafter.recipe.CRecipe
asyncGetRecipePredicateResults, asyncGetResults, firstFailedRecipePredicate, getRecipePredicateResults, getResults, getTimes, isValidRecipe, matchGroups, requiresInputItemAmountMax, requiresInputItemAmountMin -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getItems
Map<CoordinateComponent, CMatter> getItems()
Mapping of CMatter to their coordinates on the crafting slots.
-
getType
CRecipe.Type getType()
Type of this recipe. See CRecipe.Type.
-
getPredicates
List<CRecipePredicate> getPredicates()
List of CRecipePredicate that run during recipe matching.
nullor empty means no additional conditions.
-
getResults
List<ResultSupplier> getResults()
List of ResultSupplier that provide items to players.
nullor empty means no items are produced.
-
getOriginal
final Recipe getOriginal()
-
relateWith
final MappedRelation relateWith(CraftView view)
Builds a MappedRelation by matching this recipe's slots against the given view in index order.
- Parameters:
view- The crafting grid snapshot to relate against- Returns:
MappedRelation Slot mapping between this recipe and the view
-
fromVanilla
final static CVanillaRecipe fromVanilla(CraftingRecipe recipe)
Converts a vanilla CraftingRecipe to a CVanillaRecipe.
- Parameters:
recipe- A vanilla crafting recipe (ShapedRecipe, ShapelessRecipe or TransmuteRecipe)- Returns:
CVanillaRecipe The converted recipe, or
nullif recipe is neither shaped nor shapeless
-
fromShaped
final static CVanillaRecipe fromShaped(ShapedRecipe recipe)
Converts a vanilla shaped recipe to a CRecipe.
- Parameters:
recipe- A target shaped recipe- Returns:
CVanillaRecipe A result CRecipe
- Since:
5.0.11
-
fromShapeless
final static CVanillaRecipe fromShapeless(ShapelessRecipe recipe)
Converts a vanilla shapeless recipe to a CRecipe.
- Parameters:
recipe- A target shapeless recipe- Returns:
CVanillaRecipe A result CRecipe
- Since:
5.0.11
-
fromTransmute
final static CVanillaRecipe fromTransmute(TransmuteRecipe recipe)
Converts a vanilla transmute recipe to a CRecipe.
- Parameters:
recipe- A target transmute recipe- Returns:
CVanillaRecipe A result CRecipe
- Since:
5.0.21
-
-
-
-