Interface ResultSupplier
-
- All Implemented Interfaces:
public interface ResultSupplierResult items supplier of CRecipe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classResultSupplier.ContextThis class contains ResultSupplier parameters.
public classResultSupplier.Companion
-
Method Summary
Modifier and Type Method Description abstract List<ItemStack>supply(ResultSupplier.Context ctx)Supplies result items. -
-
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
-
-
-
-