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
-
Method Summary
Modifier and TypeMethodDescriptionint
void
decodeInto
(net.minecraft.network.FriendlyByteBuf buffer) Decodes the object from a buffer.void
encodeInto
(net.minecraft.network.FriendlyByteBuf buffer) Encodes the object into a buffer.boolean
Gets a description of the battle clause.getID()
Gets the unique ID of the battle clause.Gets the translated name of the battle clause.static String
getLocalizedName
(String clauseID) Gets the translated name of the battle clause.int
hashCode()
setDescription
(String description) Sets a non-default description for the clause.toString()
boolean
validateSingle
(Pokemon pokemon) Checks if the rule allows a Pokémon to be chosen for battle.boolean
validateTeam
(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:IEncodeable
Encodes the object into a buffer.- Specified by:
encodeInto
in interfaceIEncodeable
- Parameters:
buffer
- The buffer to encode the object into.
-
decodeInto
public void decodeInto(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:IEncodeable
Decodes the object from a buffer.- Specified by:
decodeInto
in interfaceIEncodeable
- Parameters:
buffer
- The buffer to decode the object from.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<BattleClause>
-
equals
-
hashCode
public int hashCode() -
toString
-