Package org.yuemi.libs.api.event
Interface SubscriptionBuilder<T extends org.bukkit.event.Event>
- Type Parameters:
T- the event type
public interface SubscriptionBuilder<T extends org.bukkit.event.Event>
A builder for creating event subscriptions.
-
Method Summary
Modifier and TypeMethodDescription@NotNull SubscriptionBuilder<T> Adds a filter to check before invoking the event handler.@NotNull EventSubscription<T> Registers the event handler and activates the subscription.@NotNull SubscriptionBuilder<T> ignoreCancelled(boolean ignoreCancelled) Sets whether to ignore cancelled events.@NotNull SubscriptionBuilder<T> priority(@NotNull org.bukkit.event.EventPriority priority) Sets the priority of the event listener.
-
Method Details
-
priority
@NotNull @NotNull SubscriptionBuilder<T> priority(@NotNull @NotNull org.bukkit.event.EventPriority priority) Sets the priority of the event listener.- Parameters:
priority- the event priority- Returns:
- this builder
-
ignoreCancelled
Sets whether to ignore cancelled events.- Parameters:
ignoreCancelled- true to ignore cancelled events, false otherwise- Returns:
- this builder
-
filter
Adds a filter to check before invoking the event handler.- Parameters:
filter- the event filter predicate- Returns:
- this builder
-
handler
Registers the event handler and activates the subscription.- Parameters:
handler- the event consumer- Returns:
- the active event subscription
-