Package com.minecolonies.api.crafting
Class CompostRecipe
java.lang.Object
com.minecolonies.api.crafting.CompostRecipe
- All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
public class CompostRecipe
extends Object
implements net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
A vanilla recipe class describing the operation of the compost barrel. Primarily this is just used to
assign different "strength" ratings to different input items; currently the actual outputs of the barrel
are fixed.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCompostRecipe(@NotNull net.minecraft.resources.ResourceLocation id, @NotNull net.minecraft.world.item.crafting.Ingredient ingredient, int strength) -
Method Summary
Modifier and TypeMethodDescription@NotNull net.minecraft.world.item.ItemStackassemble(net.minecraft.world.Container inv, net.minecraft.core.RegistryAccess access) booleancanCraftInDimensions(int width, int height) intThe number of ticks that this recipe should take to ferment into compost.@NotNull net.minecraft.resources.ResourceLocationgetId()@NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.crafting.Ingredient>Gets the list of ingredients for this recipe; there will only be one, but it is a multi-alternative stack and includes the specific count of items that are required.net.minecraft.world.item.crafting.IngredientgetInput()Get the input ingredient for this recipe (this is multiple alternative item types).@NotNull net.minecraft.world.item.ItemStackgetResultItem(net.minecraft.core.RegistryAccess access) @NotNull net.minecraft.world.item.crafting.RecipeSerializer<?>intGet the strength of this recipe.@NotNull net.minecraft.world.item.crafting.RecipeType<?>getType()static @NotNull CompostRecipeindividualize(@NotNull net.minecraft.world.item.Item item, @NotNull CompostRecipe recipe) booleanmatches(net.minecraft.world.Container inv, net.minecraft.world.level.Level worldIn) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.item.crafting.Recipe
getGroup, getRemainingItems, getToastSymbol, isIncomplete, isSpecial, showNotification
-
Constructor Details
-
CompostRecipe
public CompostRecipe(@NotNull @NotNull net.minecraft.resources.ResourceLocation id, @NotNull @NotNull net.minecraft.world.item.crafting.Ingredient ingredient, int strength)
-
-
Method Details
-
getType
@NotNull public @NotNull net.minecraft.world.item.crafting.RecipeType<?> getType()- Specified by:
getTypein interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
getId
@NotNull public @NotNull net.minecraft.resources.ResourceLocation getId()- Specified by:
getIdin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
getInput
public net.minecraft.world.item.crafting.Ingredient getInput()Get the input ingredient for this recipe (this is multiple alternative item types). UsegetIngredients()instead to also calculate the amount of items needed for one composting operation.- Returns:
- The input.
-
getStrength
public int getStrength()Get the strength of this recipe. A higher strength means fewer input items are required to craft the same quantity of output compost/dirt.- Returns:
- The strength; typically 2, 4, or 8, but other values are possible.
-
getFermentTime
public int getFermentTime()The number of ticks that this recipe should take to ferment into compost. This is currently just for informational purposes and is not configurable (nor actually used).- Returns:
- A number of ticks.
-
matches
public boolean matches(net.minecraft.world.Container inv, net.minecraft.world.level.Level worldIn) - Specified by:
matchesin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
assemble
@NotNull public @NotNull net.minecraft.world.item.ItemStack assemble(net.minecraft.world.Container inv, net.minecraft.core.RegistryAccess access) - Specified by:
assemblein interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
canCraftInDimensions
public boolean canCraftInDimensions(int width, int height) - Specified by:
canCraftInDimensionsin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
getResultItem
@NotNull public @NotNull net.minecraft.world.item.ItemStack getResultItem(net.minecraft.core.RegistryAccess access) - Specified by:
getResultItemin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
getSerializer
@NotNull public @NotNull net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()- Specified by:
getSerializerin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
getIngredients
@NotNull public @NotNull net.minecraft.core.NonNullList<net.minecraft.world.item.crafting.Ingredient> getIngredients()Gets the list of ingredients for this recipe; there will only be one, but it is a multi-alternative stack and includes the specific count of items that are required.- Specified by:
getIngredientsin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>- Returns:
- The list of input ingredients.
-
individualize
@NotNull public static @NotNull CompostRecipe individualize(@NotNull @NotNull net.minecraft.world.item.Item item, @NotNull @NotNull CompostRecipe recipe)
-