Class Moveset
- All Implemented Interfaces:
Cloneable
,Iterable<Attack>
,Collection<Attack>
,List<Attack>
,RandomAccess
A Pokémon's moveset.
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
Adds the current moves to the list of moves available via move reminder.boolean
addImmutable
(ImmutableAttack... attacks) boolean
addImmutable
(Collection<ImmutableAttack> attacks) void
clear()
boolean
copy()
Makes a copy of the moveset.void
fromBytes
(net.minecraft.network.FriendlyByteBuf buf) get
(int index) boolean
final boolean
hasAttack
(RegistryValue<ImmutableAttack>... moves) Checks if the Pokémon has one of the specified moves.boolean
Checks if the Pokémon has the specified attack.boolean
hasAttack
(ImmutableAttack... moves) Checks if the Pokémon has one of the specified moves.final boolean
hasAttack
(Optional<ImmutableAttack>... moves) Checks if the Pokémon has one of the specified moves.boolean
hasAttackCategory
(AttackCategory attackCategory) Checks if the Pokémon has an offensive attack of a certain type.boolean
Checks if all of the moves in the moveset have full PP.boolean
hasOffensiveAttackType
(Element... types) Checks if the Pokémon has an offensive attack of certain types.void
Restores the PP of all moves.boolean
isEmpty()
boolean
isHiddenAbility
(Pokemon pokemon) static Moveset
loadMoveset
(PokemonLink pokemon) Loads a Pokémon's moveset with random moves from its pokemonLevel-up movepool.void
readFromNBT
(net.minecraft.nbt.CompoundTag nbt) Reads the moveset from NBT.remove
(int index) boolean
final void
removeAttack
(RegistryValue<ImmutableAttack>... removedAttack) boolean
removeAttack
(ImmutableAttack removedAttack) final void
removeAttack
(Optional<ImmutableAttack>... removedAttack) boolean
void
Removes moves that the species/form should not be able to learnboolean
replaceMove
(RegistryValue<ImmutableAttack> oldMove, RegistryValue<ImmutableAttack> newMove, boolean persistPP) boolean
replaceMove
(RegistryValue<ImmutableAttack> oldMove, Attack newMove) Replaces a move in the moveset with another move.void
replaceWith
(List<String> attackIds) Replaces the Pokémon moveset with a new one.void
setAbility
(Ability ability) void
setTempAbility
(String tempAbility) int
size()
void
swap
(int index, int index2) Swaps the positions of two attacks.void
toBytes
(net.minecraft.network.FriendlyByteBuf buf) toString()
void
withPokemon
(Pokemon pokemon) void
writeToNBT
(net.minecraft.nbt.CompoundTag nbt) Writes the moveset to NBT.Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, removeAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
addAll, containsAll, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
pokemon
-
attacks
-
ability
-
tempAbility
-
-
Constructor Details
-
Moveset
public Moveset() -
Moveset
Initializes a moveset with attacks and an ability.- Parameters:
attacks
- The attacks in the moveset.ability
- The ability in the moveset.
-
Moveset
Initializes the moveset with an attack and an ability.- Parameters:
attack
- The attack to initialize the moveset with.ability
- The ability to initialize the moveset with.
-
-
Method Details
-
withPokemon
-
setTempAbility
-
getTempAbility
-
get
-
add
- Specified by:
add
in interfaceCollection<Attack>
- Specified by:
add
in interfaceList<Attack>
- Overrides:
add
in classAbstractList<Attack>
-
set
-
tryNotifyPokemon
public void tryNotifyPokemon() -
swap
public void swap(int index, int index2) Swaps the positions of two attacks.- Parameters:
index
- One attack to swap.index2
- The attack to swap the first attack with.
-
remove
-
removeIf
- Specified by:
removeIf
in interfaceCollection<Attack>
-
remove
- Specified by:
remove
in interfaceCollection<Attack>
- Specified by:
remove
in interfaceList<Attack>
- Overrides:
remove
in classAbstractCollection<Attack>
-
size
public int size()- Specified by:
size
in interfaceCollection<Attack>
- Specified by:
size
in interfaceList<Attack>
- Specified by:
size
in classAbstractCollection<Attack>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<Attack>
- Specified by:
isEmpty
in interfaceList<Attack>
- Overrides:
isEmpty
in classAbstractCollection<Attack>
-
contains
- Specified by:
contains
in interfaceCollection<Attack>
- Specified by:
contains
in interfaceList<Attack>
- Overrides:
contains
in classAbstractCollection<Attack>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Attack>
- Specified by:
clear
in interfaceList<Attack>
- Overrides:
clear
in classAbstractList<Attack>
-
writeToNBT
public void writeToNBT(net.minecraft.nbt.CompoundTag nbt) Writes the moveset to NBT.- Parameters:
nbt
- The NBT tag to write to.
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag nbt) Reads the moveset from NBT.- Parameters:
nbt
- The NBT tag to read from.
-
fromBytes
public void fromBytes(net.minecraft.network.FriendlyByteBuf buf) -
toBytes
public void toBytes(net.minecraft.network.FriendlyByteBuf buf) -
addCurrentMovesToReminder
public void addCurrentMovesToReminder()Adds the current moves to the list of moves available via move reminder. -
hasAttack
Checks if the Pokémon has the specified attack.- Parameters:
a
- The attack to check for.- Returns:
- Whether the Pokémon has the attack.
-
hasAttack
Checks if the Pokémon has one of the specified moves.- Parameters:
moves
- The attack(s) to look for.- Returns:
- Whether the Pokémon has one of the specified moves.
-
hasAttack
Checks if the Pokémon has one of the specified moves.- Parameters:
moves
- The attack(s) to look for.- Returns:
- Whether the Pokémon has one of the specified moves.
-
hasAttack
Checks if the Pokémon has one of the specified moves.- Parameters:
moves
- The attack(s) to look for.- Returns:
- Whether the Pokémon has one of the specified moves.
-
hasAttackCategory
Checks if the Pokémon has an offensive attack of a certain type.- Parameters:
attackCategory
- The type to look for.- Returns:
- Whether the Pokémon has an offensive attack of the specified type.
-
hasOffensiveAttackType
Checks if the Pokémon has an offensive attack of certain types.- Parameters:
types
- The types to look for.- Returns:
- Whether the Pokémon has an offensive attack of one of the specified types.
-
removeAttack
-
removeAttack
-
removeAttack
-
replaceWith
Replaces the Pokémon moveset with a new one.- Parameters:
attackIds
- The attack IDs of the moves to replace the moveset with.
-
hasFullPP
public boolean hasFullPP()Checks if all of the moves in the moveset have full PP.- Returns:
- Whether all of the moves in the moveset have full PP.
-
copy
Makes a copy of the moveset. -
replaceMove
Replaces a move in the moveset with another move.- Parameters:
oldMove
- The name of the move to replace.newMove
- The move to replace the old move with.- Returns:
- Whether the move was replaced successfully.
-
replaceMove
public boolean replaceMove(RegistryValue<ImmutableAttack> oldMove, RegistryValue<ImmutableAttack> newMove, boolean persistPP) -
healAllPP
public void healAllPP()Restores the PP of all moves. -
getReminderMoves
- Returns:
- the set of moves that can be relearned by a Move Reminder. Added to by TRs.
-
loadMoveset
Loads a Pokémon's moveset with random moves from its pokemonLevel-up movepool.- Parameters:
pokemon
- The Pokémon to load.
-
getAbility
-
setAbility
-
isHiddenAbility
-
isHiddenAbility
-
addImmutable
-
addImmutable
-
asImmutable
-
hasAbility
public boolean hasAbility() -
removeIllegalMoves
public void removeIllegalMoves()Removes moves that the species/form should not be able to learn -
toString
- Overrides:
toString
in classAbstractCollection<Attack>
-