Interface ResourcePackCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A callback for a resource pack application operation.
- Since:
- 4.15.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcePackCallbacknoOp()Create a pack callback that performs no operation.static ResourcePackCallbackonTerminal(BiConsumer<UUID, Audience> success, BiConsumer<UUID, Audience> failure) Create a pack callback that will only execute the provided functions when the pack application has completed, discarding all intermediate events.voidpackEventReceived(UUID uuid, ResourcePackStatus status, Audience audience) Called when a pack event has been received.
-
Method Details
-
noOp
Create a pack callback that performs no operation.Multiple calls to this method are guaranteed to return callback functions with equal identity.
- Returns:
- the no-op callback
- Since:
- 4.15.0
-
onTerminal
static ResourcePackCallback onTerminal(BiConsumer<UUID, Audience> success, BiConsumer<UUID, Audience> failure) Create a pack callback that will only execute the provided functions when the pack application has completed, discarding all intermediate events.- Parameters:
success- the success callbackfailure- the failure callback- Returns:
- the created callback
- Since:
- 4.15.0
-
packEventReceived
Called when a pack event has been received.If the pack apply action was executed on a group audience,
audiencewill referer to the individual member audiences the action is executed on. Forwarding audiences may wrap callbacks to ensure they receive the appropriate wrapped audience.- Parameters:
uuid- the uuid of the pack that has been applied.status- the current pack statusaudience- the audience the pack is being applied to- Since:
- 4.15.0
-