Class PixelmonBreedingLogic
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.egg.impl.PixelmonBreedingLogic
- All Implemented Interfaces:
BreedingLogicFactory
Default Pixelmon implementation of the breeding logic
- Since:
- 24/06/2022
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncalculateForm
(Pokemon parentOne, Pokemon parentTwo, Species child) Calculates the form of the child using the two parentscalculatePalette
(Pokemon parentOne, Pokemon parentTwo, Species child) Calculates the palette of the child using the two parentscalculateSpecies
(Pokemon parentOne, Pokemon parentTwo) Calculates the species created by the two parent Pokemonsboolean
Checks if the two Pokemon can breedboolean
canLearnVoltTackle
(Species species, Pokemon parentOne, Pokemon parentTwo) If the pokemon can learn volt tackle movefinal boolean
checkIncense
(net.minecraft.world.item.Item itemTypeParent, net.minecraft.world.item.Item itemTypeOther, Pokemon parentForEggLine, net.minecraft.world.item.Item neededItem, RegistryValue<Species> baby, RegistryValue<Species>... parents) Checks the incensefindFather
(Pokemon parentOne, Pokemon parentTwo) Obtains the father of the two parentsfindMother
(Pokemon parentOne, Pokemon parentTwo) Obtains the mother of the two parentsgetEggAbility
(Stats form, Pokemon parentOne, Pokemon parentTwo) Calculates the new Ability for the Pokemon from the two parentsgetEggAbilitySlot
(Stats form, Pokemon parentOne, Pokemon parentTwo) Calculates the new Ability slot for the Pokemon from the two parentsgetEggGrowth
(Pokemon parentOne, Pokemon parentTwo) Calculates the new Growth for the Pokemon from the two parentsgetEggMoves
(Stats egg, Pokemon parent, Set<ImmutableAttack> allEggMoves) Gets the egg movesgetEggMoveset
(Stats egg, Pokemon parentOne, Pokemon parentTwo) Calculates the egg move setgetFathersTMHMTutorMoves
(Stats egg, Pokemon father) Gets the father's TM, HM and Tutor movesgetFirstFourMoves
(List<ImmutableAttack> masterAttackList) Gets the first four moves from the attack list givengetIVsForEgg
(Pokemon parentOne, Pokemon parentTwo) Calculates the new IVs for the Pokemon from the two parentsgetNatureForEgg
(Pokemon parentOne, Pokemon parentTwo) Calculates the new Nature for the Pokemon from the two parentsgetPokeBall
(Pokemon parentOne, Pokemon parentTwo) Calculates the new PokeBall for the Pokemon from the two parentsgetPokemonLevelupMoves
(Stats egg, Pokemon parentOne, Pokemon parentTwo) Gets the level up moves for the eggAttempts to make an egg using the two given PokemonmakeRandomEgg
(Pokemon parentOne, Pokemon parentTwo) Makes a random Pokemon egg using the two parents for stats such as IVs and abilitiesboolean
shouldEggBeShiny
(Pokemon parentOne, Pokemon parentTwo) Check used to determine if the child should be shiny
-
Constructor Details
-
PixelmonBreedingLogic
public PixelmonBreedingLogic()
-
-
Method Details
-
makeEgg
Description copied from interface:BreedingLogicFactory
Attempts to make an egg using the two given Pokemon- Specified by:
makeEgg
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parent- Returns:
- The potential egg
-
canBreed
Description copied from interface:BreedingLogicFactory
Checks if the two Pokemon can breed- Specified by:
canBreed
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parent- Returns:
- true if they can breed
-
calculateForm
Description copied from interface:BreedingLogicFactory
Calculates the form of the child using the two parents- Specified by:
calculateForm
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parentchild
- The child species- Returns:
- The relevant form
-
calculatePalette
Description copied from interface:BreedingLogicFactory
Calculates the palette of the child using the two parents- Specified by:
calculatePalette
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parentchild
- The child species- Returns:
- The relevant palette
-
makeRandomEgg
Description copied from interface:BreedingLogicFactory
Makes a random Pokemon egg using the two parents for stats such as IVs and abilities- Specified by:
makeRandomEgg
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parent- Returns:
- The new Pokemon egg
-
calculateSpecies
Description copied from interface:BreedingLogicFactory
Calculates the species created by the two parent Pokemons- Specified by:
calculateSpecies
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parent- Returns:
- The created species
-
getIVsForEgg
Description copied from interface:BreedingLogicFactory
Calculates the new IVs for the Pokemon from the two parents- Specified by:
getIVsForEgg
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- First parentparentTwo
- Second parent- Returns:
- The new IVs
-
getNatureForEgg
Description copied from interface:BreedingLogicFactory
Calculates the new Nature for the Pokemon from the two parents- Specified by:
getNatureForEgg
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- First parentparentTwo
- Second parent- Returns:
- The new Nature
-
getPokeBall
Description copied from interface:BreedingLogicFactory
Calculates the new PokeBall for the Pokemon from the two parents- Specified by:
getPokeBall
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- First parentparentTwo
- Second parent- Returns:
- The new PokeBall
-
getEggGrowth
Description copied from interface:BreedingLogicFactory
Calculates the new Growth for the Pokemon from the two parents- Specified by:
getEggGrowth
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- First parentparentTwo
- Second parent- Returns:
- The new Growth
-
getEggAbility
Description copied from interface:BreedingLogicFactory
Calculates the new Ability for the Pokemon from the two parents- Specified by:
getEggAbility
in interfaceBreedingLogicFactory
parentOne
- First parentparentTwo
- Second parent- Returns:
- The new Ability
-
getEggAbilitySlot
public com.mojang.datafixers.util.Pair<Integer,Boolean> getEggAbilitySlot(Stats form, Pokemon parentOne, Pokemon parentTwo) Description copied from interface:BreedingLogicFactory
Calculates the new Ability slot for the Pokemon from the two parents- Specified by:
getEggAbilitySlot
in interfaceBreedingLogicFactory
parentOne
- First parentparentTwo
- Second parent- Returns:
- The new slot and whether it inherits the hidden ability
-
shouldEggBeShiny
Description copied from interface:BreedingLogicFactory
Check used to determine if the child should be shiny- Specified by:
shouldEggBeShiny
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parent- Returns:
- True if shiny
-
getEggMoveset
Description copied from interface:BreedingLogicFactory
Calculates the egg move set- Specified by:
getEggMoveset
in interfaceBreedingLogicFactory
- Parameters:
egg
- The egg's formparentOne
- The first parentparentTwo
- The second parent- Returns:
- The moveset of the child
-
getPokemonLevelupMoves
public List<ImmutableAttack> getPokemonLevelupMoves(Stats egg, Pokemon parentOne, Pokemon parentTwo) Description copied from interface:BreedingLogicFactory
Gets the level up moves for the egg- Specified by:
getPokemonLevelupMoves
in interfaceBreedingLogicFactory
- Parameters:
egg
- The form of the eggparentOne
- The first parentparentTwo
- The second parent- Returns:
- The level up moves
-
getFirstFourMoves
Description copied from interface:BreedingLogicFactory
Gets the first four moves from the attack list given- Specified by:
getFirstFourMoves
in interfaceBreedingLogicFactory
- Parameters:
masterAttackList
- The attack list- Returns:
- The move set equivalent of the attack list
-
getEggMoves
public List<ImmutableAttack> getEggMoves(Stats egg, Pokemon parent, Set<ImmutableAttack> allEggMoves) Description copied from interface:BreedingLogicFactory
Gets the egg moves- Specified by:
getEggMoves
in interfaceBreedingLogicFactory
- Parameters:
egg
- The egg's formparent
- The parentallEggMoves
- The child's egg moves- Returns:
- The egg moves
-
canLearnVoltTackle
Description copied from interface:BreedingLogicFactory
If the pokemon can learn volt tackle move- Specified by:
canLearnVoltTackle
in interfaceBreedingLogicFactory
- Parameters:
species
- The egg speciesparentOne
- The first parentparentTwo
- The second parent- Returns:
- True if it can learn volt tackle
-
getFathersTMHMTutorMoves
Description copied from interface:BreedingLogicFactory
Gets the father's TM, HM and Tutor moves- Specified by:
getFathersTMHMTutorMoves
in interfaceBreedingLogicFactory
- Parameters:
egg
- The eggfather
- The father- Returns:
- The TM, HM and Tutor moves
-
findFather
Description copied from interface:BreedingLogicFactory
Obtains the father of the two parents- Specified by:
findFather
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parent- Returns:
- The father
-
findMother
Description copied from interface:BreedingLogicFactory
Obtains the mother of the two parents- Specified by:
findMother
in interfaceBreedingLogicFactory
- Parameters:
parentOne
- The first parentparentTwo
- The second parent- Returns:
- The mother
-
checkIncense
@SafeVarargs public final boolean checkIncense(net.minecraft.world.item.Item itemTypeParent, net.minecraft.world.item.Item itemTypeOther, Pokemon parentForEggLine, net.minecraft.world.item.Item neededItem, RegistryValue<Species> baby, RegistryValue<Species>... parents) Description copied from interface:BreedingLogicFactory
Checks the incense- Specified by:
checkIncense
in interfaceBreedingLogicFactory
- Parameters:
itemTypeParent
- The parent's itemitemTypeOther
- The other itemparentForEggLine
- The egg line itemneededItem
- The required itembaby
- The baby typeparents
- The parents types- Returns:
- If the incense is used
-