Class Moveset
- All Implemented Interfaces:
Cloneable,Iterable<Attack>,Collection<Attack>,List<Attack>,RandomAccess,SequencedCollection<Attack>
A Pokémon's moveset.
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidAdds the current moves to the set of moves available via move reminder.booleanaddImmutable(ImmutableAttack... attacks) booleanaddImmutable(Collection<ImmutableAttack> attacks) voidclear()clone()booleancopy()Makes a copy of the moveset.voidfromBytes(net.minecraft.network.FriendlyByteBuf buf) get(int index) getMove(RegistryValue<ImmutableAttack> move) Gets the mutableAttackinstance for a givenImmutableAttack, if present.booleanfinal booleanhasAttack(RegistryValue<ImmutableAttack>... moves) Checks if the Pokémon has one of the specified moves.booleanChecks if the Pokémon has the specified attack.booleanhasAttack(ImmutableAttack... moves) Checks if the Pokémon has one of the specified moves.final booleanhasAttack(Optional<ImmutableAttack>... moves) Checks if the Pokémon has one of the specified moves.booleanhasAttackCategory(AttackCategory attackCategory) Checks if the Pokémon has an offensive attack of a certain type.booleanChecks if all of the moves in the moveset have full PP.booleanhasOffensiveAttackType(net.minecraft.resources.ResourceKey<Type>... types) Checks if the Pokémon has an offensive attack of certain types.voidRestores the PP of all moves.booleanisEmpty()booleanisHiddenAbility(Pokemon pokemon) voidreadFromNBT(net.minecraft.nbt.CompoundTag nbt) Reads the moveset from NBT.remove(int index) booleanfinal voidremoveAttack(RegistryValue<ImmutableAttack>... removedAttack) booleanremoveAttack(ImmutableAttack removedAttack) final voidremoveAttack(Optional<ImmutableAttack>... removedAttack) booleanvoidRemoves moves that the species/form should not be able to learnvoidremoveMovesFromReminder(ImmutableAttack... moves) Removes the given moves from the set of moves available via move reminder.voidRemoves the given moves from the set of moves available via move reminder.booleanreplaceMove(RegistryValue<ImmutableAttack> oldMove, RegistryValue<ImmutableAttack> newMove) Replaces a move in the moveset with another move.booleanreplaceMove(RegistryValue<ImmutableAttack> oldMove, RegistryValue<ImmutableAttack> newMove, boolean persistPP) Replaces a move in the moveset with another move.booleanreplaceMove(RegistryValue<ImmutableAttack> oldMove, Attack newMove) Replaces a move in the moveset with another move.booleanreplaceMove(RegistryValue<ImmutableAttack> oldMove, ImmutableAttack newMove) Replaces a move in the moveset with another move.voidreplaceWith(List<String> attackIds) Replaces the Pokémon moveset with a new one.voidsetAbility(Ability ability) voidsetTempAbility(String tempAbility) intsize()voidswap(int index, int index2) Swaps the positions of two attacks.voidtoBytes(net.minecraft.network.FriendlyByteBuf buf) toString()voidwithPokemon(Pokemon pokemon) voidwriteToNBT(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, subListMethods inherited from class java.util.AbstractCollection
addAll, containsAll, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
addAll, addFirst, addLast, containsAll, getFirst, getLast, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, 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:
addin interfaceCollection<Attack>- Specified by:
addin interfaceList<Attack>- Overrides:
addin 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:
removeIfin interfaceCollection<Attack>
-
remove
- Specified by:
removein interfaceCollection<Attack>- Specified by:
removein interfaceList<Attack>- Overrides:
removein classAbstractCollection<Attack>
-
size
public int size()- Specified by:
sizein interfaceCollection<Attack>- Specified by:
sizein interfaceList<Attack>- Specified by:
sizein classAbstractCollection<Attack>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Attack>- Specified by:
isEmptyin interfaceList<Attack>- Overrides:
isEmptyin classAbstractCollection<Attack>
-
contains
- Specified by:
containsin interfaceCollection<Attack>- Specified by:
containsin interfaceList<Attack>- Overrides:
containsin classAbstractCollection<Attack>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Attack>- Specified by:
clearin interfaceList<Attack>- Overrides:
clearin 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 set of moves available via move reminder. -
removeMovesFromReminder
Removes the given moves from the set of moves available via move reminder.- Parameters:
moves- The moves to remove.
-
removeMovesFromReminder
Removes the given moves from the set of moves available via move reminder.- Parameters:
moves- The moves to remove.
-
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
public boolean replaceMove(RegistryValue<ImmutableAttack> oldMove, RegistryValue<ImmutableAttack> newMove) 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
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
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) 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.persistPP- Whether to retain PP state of the old move.- Returns:
- Whether the move was replaced successfully.
-
getMove
Gets the mutableAttackinstance for a givenImmutableAttack, if present.- Parameters:
move- The move to find.- Returns:
- The found move, or null if not present.
-
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.
-
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:
toStringin classAbstractCollection<Attack>
-
clone
-