Class EventFilters
java.lang.Object
dev.demeng.pluginbase.event.filter.EventFilters
Defines standard event predicates for use in functional event handlers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends org.bukkit.event.Cancellable>
@NotNull Predicate<T>Returns a predicate which only returns true if the event isn't cancelledstatic <T extends org.bukkit.event.player.PlayerLoginEvent>
@NotNull Predicate<T>Returns a predicate which only returns true if the login is allowedstatic <T extends org.bukkit.event.player.AsyncPlayerPreLoginEvent>
@NotNull Predicate<T>Returns a predicate which only returns true if the login is allowedstatic <T extends org.bukkit.event.Cancellable>
@NotNull Predicate<T>Returns a predicate which only returns true if the event is cancelledstatic <T extends org.bukkit.event.player.PlayerMoveEvent>
@NotNull Predicate<T>Returns a predicate which only returns true if the player has moved over a blockstatic <T extends org.bukkit.event.player.PlayerMoveEvent>
@NotNull Predicate<T>Returns a predicate which only returns true if the player has moved over a block, not including movement directly up and down.static <T extends org.bukkit.event.player.PlayerMoveEvent>
@NotNull Predicate<T>Returns a predicate which only returns true if the player has moved over a chunk borderstatic <T extends org.bukkit.event.player.PlayerEvent>
@NotNull Predicate<T>playerHasPermission(String permission) Returns a predicate which only returns true if the player has the given permission
-
Constructor Details
-
EventFilters
public EventFilters()
-
-
Method Details
-
ignoreCancelled
@NotNull public static <T extends org.bukkit.event.Cancellable> @NotNull Predicate<T> ignoreCancelled()Returns a predicate which only returns true if the event isn't cancelled- Type Parameters:
T- the event type- Returns:
- a predicate which only returns true if the event isn't cancelled
-
ignoreNotCancelled
@NotNull public static <T extends org.bukkit.event.Cancellable> @NotNull Predicate<T> ignoreNotCancelled()Returns a predicate which only returns true if the event is cancelled- Type Parameters:
T- the event type- Returns:
- a predicate which only returns true if the event is cancelled
-
ignoreDisallowedLogin
@NotNull public static <T extends org.bukkit.event.player.PlayerLoginEvent> @NotNull Predicate<T> ignoreDisallowedLogin()Returns a predicate which only returns true if the login is allowed- Type Parameters:
T- the event type- Returns:
- a predicate which only returns true if the login is allowed
-
ignoreDisallowedPreLogin
@NotNull public static <T extends org.bukkit.event.player.AsyncPlayerPreLoginEvent> @NotNull Predicate<T> ignoreDisallowedPreLogin()Returns a predicate which only returns true if the login is allowed- Type Parameters:
T- the event type- Returns:
- a predicate which only returns true if the login is allowed
-
ignoreSameBlock
@NotNull public static <T extends org.bukkit.event.player.PlayerMoveEvent> @NotNull Predicate<T> ignoreSameBlock()Returns a predicate which only returns true if the player has moved over a block- Type Parameters:
T- the event type- Returns:
- a predicate which only returns true if the player has moved over a block
-
ignoreSameBlockAndY
@NotNull public static <T extends org.bukkit.event.player.PlayerMoveEvent> @NotNull Predicate<T> ignoreSameBlockAndY()Returns a predicate which only returns true if the player has moved over a block, not including movement directly up and down. (so jumping wouldn't return true)- Type Parameters:
T- the event type- Returns:
- a predicate which only returns true if the player has moved across a block border
-
ignoreSameChunk
@NotNull public static <T extends org.bukkit.event.player.PlayerMoveEvent> @NotNull Predicate<T> ignoreSameChunk()Returns a predicate which only returns true if the player has moved over a chunk border- Type Parameters:
T- the event type- Returns:
- a predicate which only returns true if the player has moved over a chunk border
-
playerHasPermission
@NotNull public static <T extends org.bukkit.event.player.PlayerEvent> @NotNull Predicate<T> playerHasPermission(String permission) Returns a predicate which only returns true if the player has the given permission- Type Parameters:
T- the event type- Parameters:
permission- the permission- Returns:
- a predicate which only returns true if the player has the given permission
-