Class GenericBuiltPokemonRequirement<T>
java.lang.Object
com.pixelmonmod.api.requirement.AbstractRequirement<Pokemon,PixelmonEntity,A>
com.pixelmonmod.api.pokemon.requirement.AbstractPokemonRequirement<T>
com.pixelmonmod.api.pokemon.requirement.GenericBuiltPokemonRequirement<T>
- Type Parameters:
T
- The type of the requirement
- All Implemented Interfaces:
Requirement<Pokemon,
PixelmonEntity, 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
If you want to create more complicated requirements than this allows for then you need to look at other examples such as
LogicalAndRequirement
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final GenericBuiltPokemonRequirement.Builder<T>
protected T
Fields inherited from class com.pixelmonmod.api.requirement.AbstractRequirement
keys
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
GenericBuiltPokemonRequirement
(GenericBuiltPokemonRequirement.Builder<T> builder, T value) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies the parsed requirement to the datavoid
applyMinecraft
(PixelmonEntity entityPixelmon) Applis the parsed requirement to the minecraft datastatic <T> GenericBuiltPokemonRequirement.Builder<T>
Creates a new builder for the given typeAttempts to parse the spec with the key that was found in the spec stringcreateInstance
(T value) Creates a new instance of the requirement with the given valueint
Gets the order priority of the requirement.getValue()
Gets the internal value of the requirementboolean
isDataMatch
(Pokemon pokemon) If the data type matches the parsed requirementboolean
isMinecraftMatch
(PixelmonEntity entityPixelmon) If the minecraft type matches the parsed requirementboolean
If the spec should continue processing the results after applying this requirement.Methods inherited from class com.pixelmonmod.api.requirement.AbstractRequirement
create, fits, getAliases
-
Field Details
-
builder
-
value
-
-
Constructor Details
-
GenericBuiltPokemonRequirement
-
GenericBuiltPokemonRequirement
protected GenericBuiltPokemonRequirement(GenericBuiltPokemonRequirement.Builder<T> builder, T value)
-
-
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
Description copied from class:AbstractRequirement
Attempts to parse the spec with the key that was found in the spec string- Specified by:
create
in classAbstractPokemonRequirement<T>
- Parameters:
key
- The key foundspec
- The spec being parsed- Returns:
- The parse attempt
-
createInstance
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
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
Description copied from interface:Requirement
If the minecraft type matches the parsed requirement- Specified by:
isMinecraftMatch
in interfaceRequirement<Pokemon,
PixelmonEntity, T> - Overrides:
isMinecraftMatch
in classAbstractPokemonRequirement<T>
- Parameters:
entityPixelmon
- The minecraft data to check against- Returns:
- True if a match
-
applyData
Description copied from interface:Requirement
Applies the parsed requirement to the data- Parameters:
pokemon
- The data
-
applyMinecraft
Description copied from interface:Requirement
Applis the parsed requirement to the minecraft data- Specified by:
applyMinecraft
in interfaceRequirement<Pokemon,
PixelmonEntity, T> - Overrides:
applyMinecraft
in classAbstractPokemonRequirement<T>
- Parameters:
entityPixelmon
- The minecraft data
-
getValue
Description copied from interface:Requirement
Gets the internal value of the requirement- Returns:
- The value stored
-
builder
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
-