public class ShapedRecipe extends Object implements CraftingRecipe
Modifier and Type | Class and Description |
---|---|
static class |
ShapedRecipe.Serializer |
Modifier and Type | Field and Description |
---|---|
private String |
group |
private int |
height |
private Identifier |
id |
private DefaultedList<Ingredient> |
inputs |
private ItemStack |
output |
private int |
width |
Constructor and Description |
---|
ShapedRecipe(Identifier id,
String group,
int width,
int height,
DefaultedList<Ingredient> ingredients,
ItemStack output) |
Modifier and Type | Method and Description |
---|---|
(package private) static String[] |
combinePattern(String[] lines) |
ItemStack |
craft(CraftingInventory craftingInventory) |
private static int |
findNextIngredient(String pattern) |
private static int |
findNextIngredientReverse(String pattern) |
boolean |
fits(int width,
int height) |
private static Map<String,Ingredient> |
getComponents(JsonObject json) |
String |
getGroup() |
int |
getHeight() |
Identifier |
getId() |
private static DefaultedList<Ingredient> |
getIngredients(String[] pattern,
Map<String,Ingredient> key,
int width,
int height) |
static ItemStack |
getItemStack(JsonObject json) |
ItemStack |
getOutput() |
private static String[] |
getPattern(JsonArray json) |
DefaultedList<Ingredient> |
getPreviewInputs() |
RecipeSerializer<?> |
getSerializer() |
int |
getWidth() |
boolean |
matches(CraftingInventory craftingInventory,
World world) |
private boolean |
matchesSmall(CraftingInventory inv,
int offsetX,
int offsetY,
boolean bool) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getType
getRecipeKindIcon, getRemainingStacks, isIgnoredInRecipeBook
private final int width
private final int height
private final DefaultedList<Ingredient> inputs
private final ItemStack output
private final Identifier id
private final String group
public ShapedRecipe(Identifier id, String group, int width, int height, DefaultedList<Ingredient> ingredients, ItemStack output)
public Identifier getId()
getId
in interface Recipe<CraftingInventory>
public RecipeSerializer<?> getSerializer()
getSerializer
in interface Recipe<CraftingInventory>
@Environment(value=CLIENT) public String getGroup()
getGroup
in interface Recipe<CraftingInventory>
public ItemStack getOutput()
getOutput
in interface Recipe<CraftingInventory>
public DefaultedList<Ingredient> getPreviewInputs()
getPreviewInputs
in interface Recipe<CraftingInventory>
@Environment(value=CLIENT) public boolean fits(int width, int height)
fits
in interface Recipe<CraftingInventory>
public boolean matches(CraftingInventory craftingInventory, World world)
matches
in interface Recipe<CraftingInventory>
private boolean matchesSmall(CraftingInventory inv, int offsetX, int offsetY, boolean bool)
public ItemStack craft(CraftingInventory craftingInventory)
craft
in interface Recipe<CraftingInventory>
public int getWidth()
public int getHeight()
private static DefaultedList<Ingredient> getIngredients(String[] pattern, Map<String,Ingredient> key, int width, int height)
private static int findNextIngredient(String pattern)
private static int findNextIngredientReverse(String pattern)
private static Map<String,Ingredient> getComponents(JsonObject json)
public static ItemStack getItemStack(JsonObject json)