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
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CompostRecipe(@NotNull net.minecraft.resources.ResourceLocation id, @NotNull net.minecraft.world.item.crafting.Ingredient ingredient, int strength)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.minecraft.world.item.ItemStack
    assemble(net.minecraft.world.Container inv, net.minecraft.core.RegistryAccess access)
     
    boolean
    canCraftInDimensions(int width, int height)
     
    int
    The number of ticks that this recipe should take to ferment into compost.
    @NotNull net.minecraft.resources.ResourceLocation
     
    @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.Ingredient
    Get the input ingredient for this recipe (this is multiple alternative item types).
    @NotNull net.minecraft.world.item.ItemStack
    getResultItem(net.minecraft.core.RegistryAccess access)
     
    @NotNull net.minecraft.world.item.crafting.RecipeSerializer<?>
     
    int
    Get the strength of this recipe.
    @NotNull net.minecraft.world.item.crafting.RecipeType<?>
     
    static @NotNull CompostRecipe
    individualize(@NotNull net.minecraft.world.item.Item item, @NotNull CompostRecipe recipe)
     
    boolean
    matches(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, wait

    Methods 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:
      getType in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
    • getId

      @NotNull public @NotNull net.minecraft.resources.ResourceLocation getId()
      Specified by:
      getId in interface net.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). Use getIngredients() 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:
      matches in interface net.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:
      assemble in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
    • canCraftInDimensions

      public boolean canCraftInDimensions(int width, int height)
      Specified by:
      canCraftInDimensions in interface net.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:
      getResultItem in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
    • getSerializer

      @NotNull public @NotNull net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()
      Specified by:
      getSerializer in interface net.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:
      getIngredients in interface net.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)