Class BattleQuery

java.lang.Object
com.pixelmonmod.pixelmon.battles.BattleQuery

public class BattleQuery extends Object
Controls the pre-battle challenge options between two players.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The type of battle to initiate.
    int
    The index of the query.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BattleQuery(net.minecraft.server.level.ServerPlayer player1, Pokemon pokemon1, net.minecraft.server.level.ServerPlayer player2, Pokemon pokemon2)
    Initializes a battle query with Pokémon instead of PixelmonEntities
    BattleQuery(net.minecraft.server.level.ServerPlayer player1, PixelmonEntity pokemon1, net.minecraft.server.level.ServerPlayer player2, PixelmonEntity pokemon2)
    Initializes a battle query.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    acceptQuery(net.minecraft.server.level.ServerPlayer player, EnumBattleQueryResponse response)
    Handles event where a player accepts the challenge.
     
    void
    changeRules(net.minecraft.server.level.ServerPlayer player)
    Requests that the battle rules be changed.
    void
    declineQuery(net.minecraft.server.level.ServerPlayer player)
    Closes the GUI if a player declines the battle.
    getQuery(int index)
    Finds a specific battle query instance.
    getQuery(net.minecraft.server.level.ServerPlayer player)
    Finds the battle query involving a certain player.
    void
    proposeRules(net.minecraft.server.level.ServerPlayer player, BattleRules rules)
    Proposes a set of rules to use for the battle.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • queryIndex

      public int queryIndex
      The index of the query.
    • battleRules

      public BattleRules battleRules
      The type of battle to initiate.
  • Constructor Details

    • BattleQuery

      public BattleQuery(net.minecraft.server.level.ServerPlayer player1, PixelmonEntity pokemon1, net.minecraft.server.level.ServerPlayer player2, PixelmonEntity pokemon2)
      Initializes a battle query.
      Parameters:
      player1 - The first player in the query.
      pokemon1 - The first player's lead Pokémon.
      player2 - The second player in the query.
      pokemon2 - The second player's lead Pokémon.
    • BattleQuery

      public BattleQuery(net.minecraft.server.level.ServerPlayer player1, Pokemon pokemon1, net.minecraft.server.level.ServerPlayer player2, Pokemon pokemon2)
      Initializes a battle query with Pokémon instead of PixelmonEntities
      Parameters:
      player1 - The first player in the query.
      pokemon1 - The first player's lead Pokémon.
      player2 - The second player in the query.
      pokemon2 - The second player's lead Pokémon.
  • Method Details

    • acceptQuery

      public void acceptQuery(net.minecraft.server.level.ServerPlayer player, EnumBattleQueryResponse response)
      Handles event where a player accepts the challenge.
      Parameters:
      player - The player who accepted the challenge.
      response - The player's response to the challenge.
    • declineQuery

      public void declineQuery(net.minecraft.server.level.ServerPlayer player)
      Closes the GUI if a player declines the battle.
      Parameters:
      player - The player who declined the battle.
    • proposeRules

      public void proposeRules(net.minecraft.server.level.ServerPlayer player, BattleRules rules)
      Proposes a set of rules to use for the battle.
      Parameters:
      player - The player proposing the rules.
      rules - The rules being proposed.
    • changeRules

      public void changeRules(net.minecraft.server.level.ServerPlayer player)
      Requests that the battle rules be changed.
      Parameters:
      player - The player requesting to change the rules.
    • getQuery

      public static BattleQuery getQuery(int index)
      Finds a specific battle query instance.
      Parameters:
      index - The index of the battle query.
      Returns:
      The battle query with the index, or null if no battle query has the index.
    • getQuery

      public static BattleQuery getQuery(net.minecraft.server.level.ServerPlayer player)
      Finds the battle query involving a certain player.
      Parameters:
      player - The player to find a battle query for.
      Returns:
      The query involving the player, or null if the player is not in a query.
    • builder

      public static BattleQuery.Builder builder()