public class PokemonSpec
extends java.lang.Object
EntityPixelmon
or NBT form) these
characteristics.Modifier and Type | Class and Description |
---|---|
static class |
PokemonSpec.Adapter |
Modifier and Type | Field and Description |
---|---|
java.lang.String |
ability
The name of the
AbilityBase of the Pokémon |
java.lang.String[] |
args
The original strings used to create the spec.
|
java.lang.Byte |
ball
The PokéBall shown as that used to catch the Pokémon
|
java.lang.Byte |
boss
The index of the
EnumBossMode of the Pokémon |
java.lang.Boolean |
egg
Whether or not the Pokémon should be an egg or not.
|
java.util.ArrayList<SpecValue<?>> |
extraSpecs |
static java.util.List<ISpecType> |
extraSpecTypes
The extra types of spec values that should be interpreted.
|
java.lang.Byte |
form
The form number of the Pokémon
|
java.lang.Boolean |
formInvert
Whether we should invert the search for form index
|
java.lang.String |
formString |
java.lang.Byte |
gender
The index of
Gender gender of the Pokémon |
java.lang.Boolean |
gmaxFactor
Whether or not the Pokémon has the Gigantamax Factor.
|
java.lang.Byte |
growth
The index of the
EnumGrowth of the Pokémon |
java.lang.Integer |
level
The level of the Pokémon
|
java.lang.String |
name
The name of the Pokémon
|
java.lang.Byte |
nature
The index of the
EnumNature of the Pokémon. |
java.lang.Byte |
pokerusSpread |
java.lang.Byte |
pokerusType
The index of the
EnumPokerusType of the Pokémon, if any. |
java.util.ArrayList<EnumRibbonType> |
ribbons |
java.lang.Boolean |
shiny
Whether the Pokémon must be shiny or must not be shiny.
|
static PokemonSpec.Adapter |
SPEC_ADAPTER
Type adapter for PokemonSpecs which supports object form or simple string forms of specs.
|
static SpecValueTypeAdapter |
SPEC_VALUE_TYPE_ADAPTER
Type adapter for JSON deserializing additional spec values added by sidemods.
|
Constructor and Description |
---|
PokemonSpec(io.netty.buffer.ByteBuf buf) |
PokemonSpec(java.lang.String... args) |
PokemonSpec(java.lang.String arg) |
Modifier and Type | Method and Description |
---|---|
void |
apply(EntityPixelmon pokemon)
Applies the data from this
PokemonSpec onto the given EntityPixelmon |
void |
apply(net.minecraft.nbt.NBTTagCompound nbt)
Deprecated.
|
void |
apply(Pokemon pokemon) |
PokemonSpec |
copy() |
Pokemon |
create() |
EntityPixelmon |
create(net.minecraft.world.World world)
Creates an
EntityPixelmon in the given world based on this specification. |
boolean |
equals(java.lang.Object o) |
static PokemonSpec |
from(java.lang.String... args)
Creates a
PokemonSpec based on a collection of String arguments, generally from a command. |
static PokemonSpec |
from(java.lang.String arg)
Creates a
PokemonSpec from the collection of argument represented as a String where each argument is
seperated by a space. |
void |
fromBytes(io.netty.buffer.ByteBuf buf) |
static ISpecType |
getSpecForKey(java.lang.String key) |
int |
hashCode() |
boolean |
matches(EntityPixelmon pokemon)
Determines whether the given EntityPixelmon matches the specification
|
boolean |
matches(net.minecraft.nbt.NBTTagCompound nbt)
Deprecated.
|
boolean |
matches(Pokemon pokemon) |
PokemonSpec |
readFromNBT(net.minecraft.nbt.NBTTagCompound nbt) |
static void |
registerDefaultExtraSpecs() |
void |
toBytes(io.netty.buffer.ByteBuf buf) |
java.lang.String |
toString() |
net.minecraft.nbt.NBTTagCompound |
writeToNBT(net.minecraft.nbt.NBTTagCompound nbt) |
public static final SpecValueTypeAdapter SPEC_VALUE_TYPE_ADAPTER
public static final PokemonSpec.Adapter SPEC_ADAPTER
public static final java.util.List<ISpecType> extraSpecTypes
public java.lang.String[] args
public java.lang.String name
public java.lang.Integer level
public java.lang.Byte gender
Gender
gender of the Pokémonpublic java.lang.Byte growth
EnumGrowth
of the Pokémonpublic java.lang.Byte nature
EnumNature
of the Pokémon.public java.lang.String ability
AbilityBase
of the Pokémonpublic java.lang.Byte boss
EnumBossMode
of the Pokémonpublic java.lang.Boolean shiny
public java.lang.Boolean formInvert
public java.lang.Byte form
public java.lang.String formString
public java.lang.Byte ball
public java.lang.Byte pokerusType
EnumPokerusType
of the Pokémon, if any.public java.lang.Byte pokerusSpread
public java.lang.Boolean egg
ServerQueryPC.search(PokemonStorage, String)
public java.lang.Boolean gmaxFactor
public java.util.ArrayList<EnumRibbonType> ribbons
public java.util.ArrayList<SpecValue<?>> extraSpecs
public PokemonSpec(io.netty.buffer.ByteBuf buf)
public PokemonSpec(java.lang.String arg)
public PokemonSpec(java.lang.String... args)
public static ISpecType getSpecForKey(java.lang.String key)
public static PokemonSpec from(java.lang.String arg)
PokemonSpec
from the collection of argument represented as a String where each argument is
seperated by a space. Once split it uses from(String...)
to parse them into a PokemonSpec
arg
- The pokemon argsPokemonSpec
representation of the given characteristicspublic static PokemonSpec from(java.lang.String... args)
PokemonSpec
based on a collection of String arguments, generally from a command. Badly
formatted arguments are ignored. All arguments bar ability are case insensitive. Additionally, the nature,
growth, and boss arguments may be replaced with numerical equivalents.args
- - The String array with each arg. An example of the format for each piece of data:
Example command: /pokespawn Kingdra lvl:5 gr:Enormous n:Modest ab:Sniper b:Legendary !s
Kingdra - A Kingdra
lvl:5 - Kingdra of level 5
gr:Enormous - Kingdra with the Enormous growth level
n:Modest - Kingdra with a Modest nature
ab:Sniper - Kingdra with the Sniper
ability
boss:Legendary - Kingdra with a boss mode of Legendary
!s - Kingdra that must not be shiny
f:1 - Kingdra that is of the imaginary second form. Think Burmy.
ba:dive - Kingdra that is in a Dive Ball
PokemonSpec
representation of the given characteristicspublic PokemonSpec copy()
public void fromBytes(io.netty.buffer.ByteBuf buf)
public void toBytes(io.netty.buffer.ByteBuf buf)
@Deprecated public boolean matches(net.minecraft.nbt.NBTTagCompound nbt)
nbt
- - The NBTTagCompound representation of a Pokémontrue
if they match the criteria, false
otherwisepublic boolean matches(EntityPixelmon pokemon)
pokemon
- - The EntityPixelmon representation of a Pokémontrue
if they match the criteria, false
otherwisepublic boolean matches(Pokemon pokemon)
public EntityPixelmon create(net.minecraft.world.World world)
EntityPixelmon
in the given world based on this specification. This will fail if the
PokemonSpec
does not define a name.world
- - The world in which to base this Pokémon. Often this is unimportant, but it must never be nullEntityPixelmon
instance for this specification, or null
if the name was not definedpublic Pokemon create()
@Deprecated public void apply(net.minecraft.nbt.NBTTagCompound nbt)
PokemonSpec
onto the given NBTTagCompoundnbt
- - The NBTTagCompound into which to input the specificationspublic void apply(EntityPixelmon pokemon)
PokemonSpec
onto the given EntityPixelmon
pokemon
- - The EntityPixelmon
into which to input the specificationspublic void apply(Pokemon pokemon)
public net.minecraft.nbt.NBTTagCompound writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)
public PokemonSpec readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
public java.lang.String toString()
toString
in class java.lang.Object
public static void registerDefaultExtraSpecs()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object