Interface IReplacerComponentRegistrationHandler


public interface IReplacerComponentRegistrationHandler
Handles the registration of various components used specifically for recipe replacement.

The various integrations possible are global targeting filters, and targeting strategies. Refer to their specific documentation for more details. Note that it is not necessary to register filtering rules.

Since:
10.0.0
See Also:
  • Method Details

    • registerTargetingFilter

      void registerTargetingFilter(ITargetingFilter filter)
      Registers an ITargetingFilter that will be applied globally.

      This essentially allows you to remove recipes from the list of recipes that a replacer is allowed to see or perform additional changes. Note that this targeting filter is global and positive, meaning that it will be executed on every replacer instance and will be responsible for determining which recipes the replacer is allowed to inspect.

      If this filter should be conditional, refer to IFilteringRule instead.

      Parameters:
      filter - The global filter that needs to be registered.
      Since:
      10.0.0
    • registerTargetingStrategy

      void registerTargetingStrategy(net.minecraft.resources.ResourceLocation id, ITargetingStrategy strategy)
      Registers an ITargetingStrategy for script usage.

      It is not allowed to register multiple targeting strategies with the same ID.

      Parameters:
      id - The ID of the targeting strategy.
      strategy - The targeting strategy that needs to be registered.
      Throws:
      IllegalArgumentException - If a strategy was already registered with the given id.
      Since:
      10.0.0