java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.clauses.BattleClause
com.pixelmonmod.pixelmon.battles.api.rules.clauses.tiers.Tier
All Implemented Interfaces:
IEncodeable, Comparable<BattleClause>
Direct Known Subclasses:
HierarchicalTier

public class Tier extends BattleClause
A type of battle rule that restricts the Pokémon that can be used based on a set of PokemonSpecification
  • Field Details

  • Constructor Details

    • Tier

      public Tier(String id, boolean ban, PokemonSpecification... spec)
      Initializes a new tier
      Parameters:
      id - The id of the tier/battle clause
      ban - If the tier is a ban list
      spec - The specs checked for this ban list
  • Method Details

    • validateSingle

      public boolean validateSingle(Pokemon pokemon)
      The logic executed here is - When ban is true: if a single spec matches return false (i.e. isn't valid as it matches a banned spec) However, if no spec match then return true When ban is false: if all specs match return true (i.e. all the specs match the given pokemon) If a single spec doesn't match return false (doesn't meet requirements)
      Overrides:
      validateSingle in class BattleClause
      Parameters:
      pokemon - The Pokémon to check.
      Returns:
      True if a valid single pokemon
    • getTierDescription

      public String getTierDescription()
      Gets a description of the tier for use in /tiershow.