Class InteractAuthenticator
java.lang.Object
io.github.djtpj.authenticator.Authenticator<T>
io.github.djtpj.authenticator.authenticators.PlayerAuthenticator<org.bukkit.event.player.PlayerInteractEvent>
io.github.djtpj.authenticator.authenticators.InteractAuthenticator
- Direct Known Subclasses:
ItemInteractionAuthenticator
,MaterialInteractionAuthenticator
public class InteractAuthenticator
extends PlayerAuthenticator<org.bukkit.event.player.PlayerInteractEvent>
Authenticates an Interact Event
-
Constructor Summary
ConstructorsConstructorDescriptionInteractAuthenticator
(boolean requiresSneaking, boolean requiresItem, Trait trait, org.bukkit.event.block.Action... actions) -
Method Summary
Modifier and TypeMethodDescriptionboolean
authenticate
(org.bukkit.event.player.PlayerInteractEvent event) Verifies weather a trait should run on an eventMethods inherited from class io.github.djtpj.authenticator.authenticators.PlayerAuthenticator
playerHasTrait
-
Constructor Details
-
InteractAuthenticator
public InteractAuthenticator(boolean requiresSneaking, boolean requiresItem, Trait trait, org.bukkit.event.block.Action... actions) - Parameters:
requiresSneaking
- whether the player needs to be sneakingrequiresItem
- whether the item must be non-placeable, edible, or interactable to trigger the eventtrait
- the associated traitactions
- the acceptable actions
-
-
Method Details
-
authenticate
public boolean authenticate(org.bukkit.event.player.PlayerInteractEvent event) Description copied from class:Authenticator
Verifies weather a trait should run on an event- Overrides:
authenticate
in classPlayerAuthenticator<org.bukkit.event.player.PlayerInteractEvent>
- Parameters:
event
- The event to authenticate- Returns:
- whether a trait should run on this event
-