Class AttributeModifierAttribute

java.lang.Object
org.woftnw.eof.attribute.Attribute
org.woftnw.eof.attribute.AttributeModifierAttribute

public class AttributeModifierAttribute extends Attribute
Represents a tribal attribute that uses an attribute modifier.
  • Field Summary

    Fields inherited from class Attribute

    lastTest, PREDICATE, REFRESH_ON_PREDICATE
  • Constructor Summary

    Constructors
    Constructor
    Description
    AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation)
    Create a tribe attribute using an attribute modifier.
    AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation, @Nullable Predicate<org.bukkit.entity.Player> predicate)
    Create a tribe attribute using an attribute modifier.
    AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation, @Nullable Predicate<org.bukkit.entity.Player> predicate, boolean refreshOnPredicate)
    Create a tribe attribute using an attribute modifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(@NonNull org.bukkit.entity.Player player)
    Apply this attribute.
    void
    tick(org.bukkit.entity.Player player)
    Tick this attribute.
    void
    unapply(@NonNull org.bukkit.entity.Player player)
    Unapply this attribute.

    Methods inherited from class Attribute

    meetsPredicate

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AttributeModifierAttribute

      public AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation, @Nullable Predicate<org.bukkit.entity.Player> predicate, boolean refreshOnPredicate)
      Create a tribe attribute using an attribute modifier.
      Parameters:
      attributeType - The attribute to modify.
      plugin - The plugin instance.
      amount - The amount to use for the attribute modifier.
      operation - The operation to use to apply the attribute modifier.
      predicate - The predicate that must be true to apply the attribute or null if it should always be applied.
      refreshOnPredicate - Whether this attribute should only refresh when the predicate switches from false to true.
    • AttributeModifierAttribute

      public AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation, @Nullable Predicate<org.bukkit.entity.Player> predicate)
      Create a tribe attribute using an attribute modifier.
      Parameters:
      attributeType - The attribute modifier type to apply.
      plugin - The plugin instance.
      amount - The amount to use for the attribute modifier.
      operation - The operation to use to apply the attribute modifier.
      predicate - The predicate that must be true to apply the attribute or null if it should always be applied.
    • AttributeModifierAttribute

      public AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation)
      Create a tribe attribute using an attribute modifier.
      Parameters:
      attributeType - The attribute modifier type to apply.
      plugin - The plugin instance.
      amount - The amount to use for the attribute modifier.
      operation - The operation to use to apply the attribute modifier.
  • Method Details

    • tick

      public void tick(org.bukkit.entity.Player player)
      Description copied from class: Attribute
      Tick this attribute. Subclasses should use meetsPredicate(player) in this method.
      Overrides:
      tick in class Attribute
      Parameters:
      player - The player to apply to.
    • apply

      public void apply(@NonNull org.bukkit.entity.Player player) throws IllegalArgumentException
      Description copied from class: Attribute
      Apply this attribute. This is only used when the player changes tribes or activates attributes. Subclasses should use meetsPredicate(player) in this method.
      Specified by:
      apply in class Attribute
      Parameters:
      player - The player to apply to.
      Throws:
      IllegalArgumentException
    • unapply

      public void unapply(@NonNull org.bukkit.entity.Player player) throws IllegalArgumentException
      Description copied from class: Attribute
      Unapply this attribute. This is only used when the player changes tribes or deactivates attributes. Subclasses should use meetsPredicate(player) in this method.
      Specified by:
      unapply in class Attribute
      Parameters:
      player - The player to unapply to.
      Throws:
      IllegalArgumentException