Interface ResultSupplier

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract List<ItemStack> supply(ResultSupplier.Context ctx) Supplies result items.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • supply

         abstract List<ItemStack> supply(ResultSupplier.Context ctx)

        Supplies result items.

        Implementations should respect Context.callMode. This value distinguishes whether the call is for delivering items to the player (Context.CallMode.CRAFT) or for generating a display icon only (Context.CallMode.ICON). The two modes have entirely different requirements; for Context.CallMode.ICON calls, prefer returning a fixed item or one that requires only lightweight computation, as the result is never given to the player. However, even in Context.CallMode.ICON mode, ensure the returned item is distinguishable from those of other recipes.

        If Context.asyncContext is non-null, periodically check AsyncContext.isInterrupted and return early when true to support cooperative cancellation.

        When Context.isAsync returns true, this method is invoked off the main thread. Avoid calling Bukkit API that requires the main thread directly; use a scheduler (e.g. FoliaLib) if main-thread access is needed.

        Parameters:
        ctx - Context of supply
        Returns:

        List Result items