Class MaterialInteractionAuthenticator

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.MaterialInteractionAuthenticator

public class MaterialInteractionAuthenticator extends InteractAuthenticator
  • Constructor Details

    • MaterialInteractionAuthenticator

      public MaterialInteractionAuthenticator(boolean requiresSneaking, boolean requiresItem, SimpleTrait simpleTrait, org.bukkit.Material[] requiredMaterials, org.bukkit.event.block.Action... actions)
      Parameters:
      requiresSneaking - whether the player needs to be sneaking
      requiresItem - whether the item must be non-placeable, edible, or interactable to trigger the event
      simpleTrait - the associated simpleTrait
      requiredMaterials - one of the materials required for the player to be holding
      actions - the acceptable actions
    • MaterialInteractionAuthenticator

      public MaterialInteractionAuthenticator(boolean requiresSneaking, boolean requiresItem, SimpleTrait simpleTrait, org.bukkit.Material requiredMaterial, org.bukkit.event.block.Action... 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 class InteractAuthenticator
      Parameters:
      event - The event to authenticate
      Returns:
      whether a trait should run on this event