public class PokemonBase extends java.lang.Object implements ITranslatable
Modifier and Type | Field and Description |
---|---|
protected PokeBall |
ball |
protected int |
eggCycles |
protected Stats |
form |
protected Gender |
gender |
protected PaletteProperties |
palette |
protected Species |
species |
static DataSync<? extends AbstractBaseEntity,PokemonBase> |
SYNC_POKEMON_BASE |
Constructor and Description |
---|
PokemonBase()
Default constructor
|
PokemonBase(Pokemon pokemon)
Copies the base of the Pokemon
|
PokemonBase(Species pokemon)
Initializes a Pokémon in its default form,
Gender.MALE , and no custom palette |
PokemonBase(Species species,
Stats form) |
PokemonBase(Species species,
Stats form,
Gender gender)
Initializes the pokemon base with no custom palette
|
PokemonBase(Species species,
Stats form,
PaletteProperties palette,
Gender gender)
Initializes the pokemon base with specified values
|
PokemonBase(Species species,
Stats form,
PaletteProperties palette,
Gender gender,
int eggCycles,
PokeBall ball)
Initializes the pokemon base with specified values
|
PokemonBase(Species species,
Stats form,
PaletteProperties palette,
Gender gender,
PokeBall ball)
Initializes the pokemon base with specified values
|
Modifier and Type | Method and Description |
---|---|
static PokemonBase |
fromNBT(net.minecraft.nbt.CompoundNBT nbt) |
PokeBall |
getBall()
Gets the ball the pokemon is in
|
int |
getEggCycles()
Gets the number of egg cycles for the pokemon
|
Stats |
getForm()
Gets the form of the pokemon
|
Gender |
getGender()
Gets the gender of the pokemon
|
GenderProperties |
getGenderProperties()
Gets the gender properties of the pokemon
|
PaletteProperties |
getPalette()
Gets the palette of the pokemon
|
Species |
getSpecies()
Gets the species of the pokemon
|
net.minecraft.util.ResourceLocation |
getSprite()
Gets the relevant sprite for the
PokemonBase |
java.lang.String |
getTranslationKey() |
boolean |
hasChild(Species species)
Checks if the Pokemon has a child of the given species
|
boolean |
hasPalette(java.lang.String palette)
Checks if the pokemon has the provided palette
|
void |
invalidate() |
boolean |
isDefaultForm()
Checks if the form of the pokemon is the default form for the species
|
boolean |
isDefaultPalette()
Checks if the palette of the poekmon is the default palette for the form
|
boolean |
isEgg()
Checks if the pokemon is an egg
|
boolean |
isPalette(java.lang.String palette)
Checks if the palette of the pokemon is the given name
|
boolean |
isPokemon(java.util.Collection<Species> species)
Checks if the given pokemon is one of the ones provided
|
boolean |
isPokemon(Species... species)
Checks if the given pokemon is one of the ones provided
|
boolean |
isPokemonOptional(java.util.Collection<java.util.Optional<Species>> species)
Checks if the given pokemon is one of the ones provided
|
boolean |
isPokemonOptional(java.util.Optional<Species>... species)
Checks if the given pokemon is one of the ones provided
|
boolean |
isPokemonOptional(RegistryValue<Species>... species) |
boolean |
isPokemonValue(java.util.Collection<RegistryValue<Species>> species)
Checks if the given pokemon is one of the ones provided
|
boolean |
isShiny()
Short cut method for checking if a pokemon is shiny
|
PokemonBase |
makeEgg()
Turns the pokemon into an egg
|
void |
setBall(PokeBall ball)
Sets the ball the pokemon is in
|
void |
setEggCycles(java.lang.Integer eggCycles) |
void |
setEggCycles(java.lang.Integer eggCycles,
boolean event)
Sets the egg cycles of the pokemon
|
void |
setForm(Stats form) |
boolean |
setForm(java.lang.String form) |
boolean |
setPalette(PaletteProperties palette)
Sets the palette properties for the Pokemon
|
Pokemon |
toPokemon() |
net.minecraft.nbt.CompoundNBT |
writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
Writes the values of this class into an
CompoundNBT |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLocalizedName, getTranslatedName
public static final DataSync<? extends AbstractBaseEntity,PokemonBase> SYNC_POKEMON_BASE
protected Species species
protected Stats form
protected Gender gender
protected PaletteProperties palette
protected PokeBall ball
protected int eggCycles
public PokemonBase()
public PokemonBase(Pokemon pokemon)
pokemon
- The pokemonpublic PokemonBase(Species pokemon)
Gender.MALE
, and no custom palettepokemon
- The Pokémon's pokemon.public PokemonBase(Species species, Stats form, Gender gender)
species
- The speciesform
- The formgender
- The genderpublic PokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender)
species
- The speciesform
- The formpalette
- The custom palettegender
- The genderpublic PokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender, PokeBall ball)
species
- The speciesform
- The formpalette
- The custom palettegender
- The genderball
- The ball the pokemon is inpublic PokemonBase(Species species, Stats form, PaletteProperties palette, Gender gender, int eggCycles, PokeBall ball)
species
- The speciesform
- The formpalette
- The custom palettegender
- The gendereggCycles
- The egg cyles - null if not an eggball
- The ball the pokemon is inpublic Species getSpecies()
public Stats getForm()
public boolean isDefaultForm()
public boolean isDefaultPalette()
public Gender getGender()
public GenderProperties getGenderProperties()
public PaletteProperties getPalette()
public boolean hasPalette(java.lang.String palette)
palette
- The palettepublic boolean isPalette(java.lang.String palette)
palette
- The name of the palette being checked forpublic boolean isShiny()
public boolean isPokemon(Species... species)
species
- The array of species being checkedpublic boolean isPokemon(java.util.Collection<Species> species)
species
- The collection of species being checked@SafeVarargs public final boolean isPokemonOptional(java.util.Optional<Species>... species)
species
- The array of species being checked@SafeVarargs public final boolean isPokemonOptional(RegistryValue<Species>... species)
public final boolean isPokemonOptional(java.util.Collection<java.util.Optional<Species>> species)
species
- The collection of species being checkedpublic final boolean isPokemonValue(java.util.Collection<RegistryValue<Species>> species)
species
- The collection of species being checkedpublic PokeBall getBall()
public void setBall(PokeBall ball)
ball
- The new pokeballpublic void setForm(Stats form)
public boolean setForm(java.lang.String form)
public PokemonBase makeEgg()
public boolean isEgg()
public int getEggCycles()
public void setEggCycles(java.lang.Integer eggCycles)
public void setEggCycles(java.lang.Integer eggCycles, boolean event)
eggCycles
- The new egg cycles numberpublic boolean setPalette(PaletteProperties palette)
palette
- The new palette propertiespublic net.minecraft.util.ResourceLocation getSprite()
PokemonBase
ResourceLocation
of the spritepublic net.minecraft.nbt.CompoundNBT writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
CompoundNBT
nbt
- The nbt being written topublic static PokemonBase fromNBT(net.minecraft.nbt.CompoundNBT nbt)
public boolean hasChild(Species species)
species
- The child species being checkedpublic void invalidate()
public java.lang.String getTranslationKey()
getTranslationKey
in interface ITranslatable
public Pokemon toPokemon()