Class TokenPerk

  • All Implemented Interfaces:
    java.lang.Comparable<Configurable>

    public abstract class TokenPerk
    extends Perk
    Represents a Perk which works with collectible tokens.
    • Constructor Detail

      • TokenPerk

        public TokenPerk​(org.bukkit.plugin.java.JavaPlugin plugin,
                         PerkUser p)
    • Method Detail

      • setupPerk

        protected final void setupPerk()
        Description copied from class: Perk
        Created for the other abstract Perk classes. Gets called just before onStart().
        Overrides:
        setupPerk in class Perk
      • addToken

        protected void addToken​(int amount)
        Adds an amount (can be negative) to the total Tokens and then updates the Player's Display. If the number of tokens is less than 0, it sets the number of Tokens to 0.
        Parameters:
        amount - The amount of Tokens it should add (or subtract)
      • getTokens

        protected int getTokens()
        Gets the amount of tokens.
        Returns:
        The amount of tokens.
      • resetTokens

        protected void resetTokens()
        Sets the amount of tokens to 0 and then updates the Player's Display.