Class ResultItemGiveFailEvent
-
- All Implemented Interfaces:
public final class ResultItemGiveFailEvent extends Event
Fired when CustomCrafterAPI fails to deliver one or more result items to the player (for example, when the player's inventory is full).
Use getResultsIfNotObtained to claim the remaining items and handle delivery yourself. Once claimed, subsequent calls to getResultsIfNotObtained return
null.This event is not cancellable.
- Since:
5.0.21
-
-
Field Summary
Fields Modifier and Type Field Description public final static HandlerListHANDLER_LISTprivate final ResultSupplier.ContextusedSupplierContextprivate final BooleanisAsynchronousprivate final HandlerListhandlersprivate final StringeventName
-
Constructor Summary
Constructors Constructor Description ResultItemGiveFailEvent(List<ItemStack> remainingResults, ResultSupplier.Context usedSupplierContext, Boolean isAsync)
-
Method Summary
Modifier and Type Method Description final ResultSupplier.ContextgetUsedSupplierContext()HandlerListgetHandlers()final List<ItemStack>getResultsIfNotObtained()Returns the undistributed items and marks them as obtained. final BooleanisResultObtained()Returns whether the result items have already been claimed via getResultsIfNotObtained. final static HandlerListgetHandlerList()-
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous -
Methods inherited from class io.github.sakaki_aruka.customcrafter.event.failure.ResultItemGiveFailEvent
getHandlers -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ResultItemGiveFailEvent
ResultItemGiveFailEvent(List<ItemStack> remainingResults, ResultSupplier.Context usedSupplierContext, Boolean isAsync)
- Parameters:
remainingResults- The result items that could not be deliveredusedSupplierContext- The context used by the ResultSupplier that produced the items;nullif unavailableisAsync- Whether this event is fired from an asynchronous thread
-
-
Method Detail
-
getUsedSupplierContext
final ResultSupplier.Context getUsedSupplierContext()
-
getHandlers
HandlerList getHandlers()
-
getResultsIfNotObtained
final List<ItemStack> getResultsIfNotObtained()
Returns the undistributed items and marks them as obtained.
Returns
nullif the items have already been claimed by a previous call. This ensures that only one handler receives and processes the items.- Returns:
List the remaining result items, or
nullif already claimed- Since:
5.0.21
-
isResultObtained
final Boolean isResultObtained()
Returns whether the result items have already been claimed via getResultsIfNotObtained.
- Returns:
Boolean
trueif the items have already been obtained- Since:
5.0.21
-
getHandlerList
final static HandlerList getHandlerList()
-
-
-
-