Class GenericBuiltPokemonRequirement<T>
java.lang.Object
com.pixelmonmod.api.requirement.AbstractRequirement<Pokemon,PixelmonEntity,T>
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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GenericBuiltPokemonRequirement.Builder<T> protected TFields inherited from class com.pixelmonmod.api.requirement.AbstractRequirement
keys -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedGenericBuiltPokemonRequirement(GenericBuiltPokemonRequirement.Builder<T> builder, T value) -
Method Summary
Modifier and TypeMethodDescriptionvoidApplies the parsed requirement to the datavoidapplyMinecraft(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 valueintGets the order priority of the requirement.getValue()Gets the internal value of the requirementbooleanisDataMatch(Pokemon pokemon) If the data type matches the parsed requirementbooleanisMinecraftMatch(PixelmonEntity entityPixelmon) If the minecraft type matches the parsed requirementbooleanIf 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:RequirementGets 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:RequirementIf 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:AbstractRequirementAttempts to parse the spec with the key that was found in the spec string- Specified by:
createin classAbstractPokemonRequirement<T>- Parameters:
key- The key foundspec- The spec being parsed- Returns:
- The parse attempt
-
createInstance
Description copied from interface:RequirementCreates a new instance of the requirement with the given value- Parameters:
value- The value- Returns:
- The new requirement instance
-
isDataMatch
Description copied from interface:RequirementIf the data type matches the parsed requirement- Parameters:
pokemon- The data to check against- Returns:
- True if a match
-
isMinecraftMatch
Description copied from interface:RequirementIf the minecraft type matches the parsed requirement- Specified by:
isMinecraftMatchin interfaceRequirement<Pokemon,PixelmonEntity, T> - Overrides:
isMinecraftMatchin classAbstractPokemonRequirement<T>- Parameters:
entityPixelmon- The minecraft data to check against- Returns:
- True if a match
-
applyData
Description copied from interface:RequirementApplies the parsed requirement to the data- Parameters:
pokemon- The data
-
applyMinecraft
Description copied from interface:RequirementApplis the parsed requirement to the minecraft data- Specified by:
applyMinecraftin interfaceRequirement<Pokemon,PixelmonEntity, T> - Overrides:
applyMinecraftin classAbstractPokemonRequirement<T>- Parameters:
entityPixelmon- The minecraft data
-
getValue
Description copied from interface:RequirementGets 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
-