Class ItemInteractionAuthenticator
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
io.github.djtpj.authenticator.authenticators.ItemInteractionAuthenticator
Authenticates an Item Interaction event if the player is holding a specific item
-
Constructor Summary
ConstructorsConstructorDescriptionItemInteractionAuthenticator
(org.bukkit.inventory.ItemStack[] items, boolean requiresSneaking, boolean requiresItem, SimpleTrait simpleTrait, org.bukkit.event.block.Action... actions) ItemInteractionAuthenticator
(org.bukkit.inventory.ItemStack item, boolean requiresSneaking, boolean requiresItem, SimpleTrait simpleTrait, 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
-
ItemInteractionAuthenticator
public ItemInteractionAuthenticator(org.bukkit.inventory.ItemStack[] items, boolean requiresSneaking, boolean requiresItem, SimpleTrait simpleTrait, org.bukkit.event.block.Action... actions) - Parameters:
items
- the list of items that the player must hold one ofrequiresSneaking
- whether the player needs to be sneakingrequiresItem
- whether the item must be non-placeable, edible, or interactable to trigger the eventsimpleTrait
- the associated simpleTraitactions
- the acceptable actions
-
ItemInteractionAuthenticator
public ItemInteractionAuthenticator(org.bukkit.inventory.ItemStack item, boolean requiresSneaking, boolean requiresItem, SimpleTrait simpleTrait, org.bukkit.event.block.Action... actions) - Parameters:
item
- the item the player must holdrequiresSneaking
- whether the player needs to be sneakingrequiresItem
- whether the item must be non-placeable, edible, or interactable to trigger the eventsimpleTrait
- the associated simpleTraitactions
- 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 classInteractAuthenticator
- Parameters:
event
- The event to authenticate- Returns:
- whether a trait should run on this event
-