Class GenericBuiltPokemonRequirement.Builder<T>
java.lang.Object
com.pixelmonmod.api.pokemon.requirement.GenericBuiltPokemonRequirement.Builder<T>
- Type Parameters:
T
- The type of the requirement
- Enclosing class:
- GenericBuiltPokemonRequirement<T>
Builder for
GenericBuiltPokemonRequirement
-
Field Summary
Modifier and TypeFieldDescriptionprotected BiConsumer<Pokemon,
T> protected BiPredicate<Pokemon,
T> protected BiConsumer<PixelmonEntity,
T> protected BiPredicate<PixelmonEntity,
T> protected BiFunction<String,
String, ParseAttempt<T>> protected int
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the aliases for the requirementSets the aliases for the requirementSets the parser to parse a boolean from the keybuild()
Creates a newGenericBuiltPokemonRequirement
from the builderSets the requirement to continue looking for other requirements after this onedataApplier
(BiConsumer<Pokemon, T> dataApplier) Sets the applier that applies to the Pokemon datadataMatcher
(BiPredicate<Pokemon, T> dataMatcher) Sets the matcher that applies to the Pokemon dataSets the parser to parse an integer from the keyminecraftApplier
(BiConsumer<PixelmonEntity, T> minecraftApplier) Sets the applier that applies to the Minecraft entity
If not assigned this will default to the data applierminecraftMatcher
(BiPredicate<PixelmonEntity, T> minecraftMatcher) Sets the matcher that applies to the Minecraft entity
If not assigned this will default to the data matcherprotected static boolean
parser
(BiFunction<String, String, ParseAttempt<T>> parser) Sets the parser for the requirementpriority
(int priority) Sets the priority for the requirement
Defaults to 1
The higher the priority the sooner it will be checkedshouldContinue
(boolean shouldContinue) Sets if the requirement should continue looking for other requirements after this one
Defaults to trueSets the requirement to stop looking for other requirements after this oneSets the parser to parse a double from the key
-
Field Details
-
aliases
-
priority
protected int priority -
shouldContinue
protected boolean shouldContinue -
parser
-
dataMatcher
-
minecraftMatcher
-
dataApplier
-
minecraftApplier
-
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
aliases
Sets the aliases for the requirement- Parameters:
aliases
- The aliases- Returns:
- The builder
-
aliases
Sets the aliases for the requirement- Parameters:
aliases
- The aliases- Returns:
- The builder
-
priority
Sets the priority for the requirement
Defaults to 1
The higher the priority the sooner it will be checked- Parameters:
priority
- The priority- Returns:
- The builder
-
continuesAfterParse
Sets the requirement to continue looking for other requirements after this one- Returns:
- The builder
-
stopsAfterParse
Sets the requirement to stop looking for other requirements after this one- Returns:
- The builder
-
shouldContinue
Sets if the requirement should continue looking for other requirements after this one
Defaults to true- Parameters:
shouldContinue
- If the requirement should continue looking for other requirements after this one- Returns:
- The builder
-
parser
public GenericBuiltPokemonRequirement.Builder<T> parser(BiFunction<String, String, ParseAttempt<T>> parser) Sets the parser for the requirement- Parameters:
parser
- The parser- Returns:
- The builder
-
intParser
Sets the parser to parse an integer from the key- Returns:
- The builder
-
stringParser
Sets the parser to parse a double from the key- Returns:
- The builder
-
booleanParser
Sets the parser to parse a boolean from the key- Returns:
- The builder
-
parseBoolean
-
dataMatcher
Sets the matcher that applies to the Pokemon data- Parameters:
dataMatcher
- The matcher- Returns:
- The builder
-
minecraftMatcher
public GenericBuiltPokemonRequirement.Builder<T> minecraftMatcher(BiPredicate<PixelmonEntity, T> minecraftMatcher) Sets the matcher that applies to the Minecraft entity
If not assigned this will default to the data matcher- Parameters:
minecraftMatcher
- The matcher- Returns:
- The builder
-
dataApplier
Sets the applier that applies to the Pokemon data- Parameters:
dataApplier
- The applier- Returns:
- The builder
-
minecraftApplier
public GenericBuiltPokemonRequirement.Builder<T> minecraftApplier(BiConsumer<PixelmonEntity, T> minecraftApplier) Sets the applier that applies to the Minecraft entity
If not assigned this will default to the data applier- Parameters:
minecraftApplier
- The applier- Returns:
- The builder
-
build
Creates a newGenericBuiltPokemonRequirement
from the builder- Returns:
- The new requirement
-