Class PlaceholderApiCondition

java.lang.Object
fr.andross.banitem.utils.PlaceholderApiCondition

public class PlaceholderApiCondition extends Object
A PlaceholderAPI condition handler class, linked to BanActionData, in order to apply a ban on an item only if the Placeholder API value match a configured value. Only available if hook with PlaceholderAPI plugin is enabled.
  • Constructor Details

    • PlaceholderApiCondition

      public PlaceholderApiCondition(String placeholderConditionConfiguration) throws IllegalArgumentException
      Prepare a PlaceholderAPI condition check. The configuration must have the syntax:
      • %placeholder_value%=expectedValue - for exact string matching
      • %placeholder_value%=#expectedRegex - for regex matching
      Parameters:
      placeholderConditionConfiguration - a placeholder API condition handler
      Throws:
      IllegalArgumentException
  • Method Details

    • doesConditionMatch

      public boolean doesConditionMatch(org.bukkit.entity.Player player)
      Check if the current placeholder value for the player match the configured expected value.
      Parameters:
      player - the involved player
      Returns:
      true if the placeholder value matches the configured expected value, otherwise false