Class BattleClause
java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.clauses.BattleClause
- All Implemented Interfaces:
IEncodeable,Comparable<BattleClause>
- Direct Known Subclasses:
AbilityClause,ItemPreventClause,LogicalAndBattleClause,LogicalOrBattleClause,MaximumOneBatonPass,MoveClause,MultipleSpeciesClause,NoDuplicateItemClause,PokemonBanClause,SkyBattleClause,SpeedPassClause,Tier
A clause that imposes restrictions on a battle.
The unique ID of the battle clause. Should not be the same as another clause ID, and should not be a reserved
keyword ("e", "f", "n").
The description of the clause, if not using the default lang key. If this is null, the description will use the
lang key at "gui.battlerules.description.".
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoiddecodeInto(net.minecraft.network.FriendlyByteBuf buffer) Decodes the object from a buffer.voidencodeInto(net.minecraft.network.FriendlyByteBuf buffer) Encodes the object into a buffer.booleanGets a description of the battle clause.getID()Gets the unique ID of the battle clause.Gets the translated name of the battle clause.static StringgetLocalizedName(String clauseID) Gets the translated name of the battle clause.inthashCode()setDescription(String description) Sets a non-default description for the clause.toString()booleanvalidateSingle(Pokemon pokemon) Checks if the rule allows a Pokémon to be chosen for battle.booleanvalidateTeam(List<Pokemon> team) Checks if the rule allows a list of Pokémon to be chosen for battle.
-
Constructor Details
-
BattleClause
Initializes a battle clause definition.- Parameters:
id- The unique ID of the battle clause.
-
-
Method Details
-
setDescription
Sets a non-default description for the clause.- Parameters:
description- The description of the clause.- Returns:
- The battle clause instance.
-
getID
Gets the unique ID of the battle clause.- Returns:
- The unique ID of the battle clause.
-
getDescription
Gets a description of the battle clause.- Returns:
- A description of the battle clause.
-
getLocalizedName
Gets the translated name of the battle clause.- Returns:
- The translated name of the battle clause.
-
getLocalizedName
Gets the translated name of the battle clause.- Parameters:
clauseID- The ID of the clause to translate.- Returns:
- The translated name of the battle clause.
-
validateSingle
Checks if the rule allows a Pokémon to be chosen for battle.- Parameters:
pokemon- The Pokémon to check.- Returns:
- Whether the rule allows the given Pokémon to be chosen for battle.
-
validateTeam
Checks if the rule allows a list of Pokémon to be chosen for battle.- Parameters:
team- The Pokémon to check.- Returns:
- Whether the rule allows the given team to be chosen for battle.
-
encodeInto
public void encodeInto(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:IEncodeableEncodes the object into a buffer.- Specified by:
encodeIntoin interfaceIEncodeable- Parameters:
buffer- The buffer to encode the object into.
-
decodeInto
public void decodeInto(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:IEncodeableDecodes the object from a buffer.- Specified by:
decodeIntoin interfaceIEncodeable- Parameters:
buffer- The buffer to decode the object from.
-
compareTo
- Specified by:
compareToin interfaceComparable<BattleClause>
-
equals
-
hashCode
public int hashCode() -
toString
-