Interface IGatherReplacementExclusionEvent


public interface IGatherReplacementExclusionEvent
Fired whenever replacement exclusions for a specific IRecipeManager need to be gathered.

Recipe names that are added in this event will then be excluded from the set of recipes that Replacers are allowed to modify, meaning that users will have to remove and add recipes manually instead of being able to resort to automated tools.

Mods should add recipes to this event if and only if replacement is actually impossible, and not based on whether replacement is supported on their end or not. As an example, minecraft:armor_dye is a recipe that is hardcoded and thus cannot have its ingredients replaced: this is a good candidate to exclude.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addExclusion(net.minecraft.resources.ResourceLocation id)
    Adds the given ResourceLocation to the list of recipe names that will be excluded.
    void
    addExclusion(net.minecraft.world.item.crafting.Recipe<?> recipe)
    Adds the name of the given Recipe to the list of recipe names that will be excluded.
    Collection<net.minecraft.resources.ResourceLocation>
    Gets an immutable view of the recipe names that have currently been excluded.
    Gets the targeted manager this event is being fired for.
  • Method Details

    • getTargetedManager

      IRecipeManager getTargetedManager()
      Gets the targeted manager this event is being fired for.
      Returns:
      The targeted manager this event is being fired for.
    • getExcludedRecipes

      Collection<net.minecraft.resources.ResourceLocation> getExcludedRecipes()
      Gets an immutable view of the recipe names that have currently been excluded.
      Returns:
      An immutable view of the recipe names that have currently been excluded.
    • addExclusion

      void addExclusion(net.minecraft.resources.ResourceLocation id)
      Adds the given ResourceLocation to the list of recipe names that will be excluded.
      Parameters:
      id - The ID of the recipe to exclude.
    • addExclusion

      void addExclusion(net.minecraft.world.item.crafting.Recipe<?> recipe)
      Adds the name of the given Recipe to the list of recipe names that will be excluded.
      Parameters:
      recipe - The recipe that will be excluded.