Class GenericBuiltPokemonRequirement<T>

Type Parameters:
T - The type of the requirement
All Implemented Interfaces:
Requirement<Pokemon,PixelmonEntity,T>

public class GenericBuiltPokemonRequirement<T> extends AbstractPokemonRequirement<T>
A generic Pokemon requirement that can be built using a builder.
If you want to create more complicated requirements than this allows for then you need to look at other examples such as LogicalAndRequirement
  • Field Details

  • Constructor Details

  • Method Details

    • getPriority

      public int getPriority()
      Description copied from interface: Requirement
      Gets the order priority of the requirement. Higher number = higher priority (i.e. it is applied first)
      Returns:
      The priority
    • shouldContinue

      public boolean shouldContinue()
      Description copied from interface: Requirement
      If the spec should continue processing the results after applying this requirement.
      For example, for a logical AND this would return false as it handles the processing of the remaining requirements
      Returns:
      True if it should continue processing
    • create

      public ParseAttempt<List<Requirement<Pokemon,PixelmonEntity,?>>> create(String key, String spec)
      Description copied from class: AbstractRequirement
      Attempts to parse the spec with the key that was found in the spec string
      Specified by:
      create in class AbstractPokemonRequirement<T>
      Parameters:
      key - The key found
      spec - The spec being parsed
      Returns:
      The parse attempt
    • createInstance

      public ParseAttempt<Requirement<Pokemon,PixelmonEntity,T>> createInstance(T value)
      Description copied from interface: Requirement
      Creates a new instance of the requirement with the given value
      Parameters:
      value - The value
      Returns:
      The new requirement instance
    • isDataMatch

      public boolean isDataMatch(Pokemon pokemon)
      Description copied from interface: Requirement
      If the data type matches the parsed requirement
      Parameters:
      pokemon - The data to check against
      Returns:
      True if a match
    • isMinecraftMatch

      public boolean isMinecraftMatch(PixelmonEntity entityPixelmon)
      Description copied from interface: Requirement
      If the minecraft type matches the parsed requirement
      Specified by:
      isMinecraftMatch in interface Requirement<Pokemon,PixelmonEntity,T>
      Overrides:
      isMinecraftMatch in class AbstractPokemonRequirement<T>
      Parameters:
      entityPixelmon - The minecraft data to check against
      Returns:
      True if a match
    • applyData

      public void applyData(Pokemon pokemon)
      Description copied from interface: Requirement
      Applies the parsed requirement to the data
      Parameters:
      pokemon - The data
    • applyMinecraft

      public void applyMinecraft(PixelmonEntity entityPixelmon)
      Description copied from interface: Requirement
      Applis the parsed requirement to the minecraft data
      Specified by:
      applyMinecraft in interface Requirement<Pokemon,PixelmonEntity,T>
      Overrides:
      applyMinecraft in class AbstractPokemonRequirement<T>
      Parameters:
      entityPixelmon - The minecraft data
    • getValue

      public T getValue()
      Description copied from interface: Requirement
      Gets the internal value of the requirement
      Returns:
      The value stored
    • builder

      public static <T> GenericBuiltPokemonRequirement.Builder<T> builder(Class<T> type)
      Creates a new builder for the given type
      Type Parameters:
      T - The type of the requirement
      Parameters:
      type - The type of the requirement - This class does nothing but allows for type inference
      Returns:
      The new builder