Class LearnMoveController

java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.LearnMoveController

public class LearnMoveController extends Object
Created by Jay113355 on 3/3/2021.
  • Constructor Details

    • LearnMoveController

      public LearnMoveController()
  • Method Details

    • canLearnMove

      public static boolean canLearnMove(net.minecraft.server.level.ServerPlayer player, UUID pokemon, ImmutableAttack move)
      Called via the ReplaceMovePacket packet to verify the player could learn this move.
      Parameters:
      player - The player trying to learn the move.
      pokemon - The uuid of the pokemon learning the move.
      move - The move the player is trying to learn.
      Returns:
      true if server knows about them learning this move, false otherwise.
    • hasCondition

      public static boolean hasCondition(net.minecraft.server.level.ServerPlayer player, UUID pokemon, ImmutableAttack move)
    • addLearnMove

      public static void addLearnMove(net.minecraft.server.level.ServerPlayer player, UUID pokemon, ImmutableAttack move)
    • addLearnMove

      public static void addLearnMove(net.minecraft.server.level.ServerPlayer player, UUID pokemon, ImmutableAttack move, Predicate<net.minecraft.server.level.ServerPlayer> condition)
    • sendLearnMove

      public static void sendLearnMove(net.minecraft.server.level.ServerPlayer player, UUID pokemon, ImmutableAttack move)
      Registers the move and opens the move replacement screen. This should only be used if the Pokemon's Moveset is full. You should check if the Pokemon's Moveset has less then 4 moves. If so, then simply add the move and send a message telling them it was added.
      Parameters:
      player - The player who owns the pokemon and will choose which move to replace.
      pokemon - The pokemon who will learn the move.
      move - The move the pokemon will learn.
    • sendLearnMove

      public static void sendLearnMove(net.minecraft.server.level.ServerPlayer player, UUID pokemon, ImmutableAttack move, boolean checkEvo)
      Registers the move and opens the move replacement screen. This should only be used if the Pokemon's Moveset is full. You should check if the Pokemon's Moveset has less then 4 moves. If so, then simply add the move and send a message telling them it was added.
      Parameters:
      player - The player who owns the pokemon and will choose which move to replace.
      pokemon - The pokemon who will learn the move.
      move - The move the pokemon will learn.
    • sendLearnMove

      public static void sendLearnMove(net.minecraft.server.level.ServerPlayer player, UUID pokemon, ImmutableAttack move, Predicate<net.minecraft.server.level.ServerPlayer> condition)
      Registers the move and opens the move replacement screen. This should only be used if the Pokemon's Moveset is full. You should check if the Pokemon's Moveset has less then 4 moves. If so, then simply add the move and send a message telling them it was added.
      Parameters:
      player - The player who owns the pokemon and will choose which move to replace.
      pokemon - The pokemon who will learn the move.
      move - The move the pokemon will learn.
      condition - A predicate that will be called after the user has selected to learn the move. If you return false the move learning will be canceled. It is recommended you send a message before returning false.
    • clearLearnMoves

      public static void clearLearnMoves(net.minecraft.server.level.ServerPlayer player)
    • clearLearnMoves

      public static void clearLearnMoves(UUID player)
    • itemCostCondition

      public static Predicate<net.minecraft.server.level.ServerPlayer> itemCostCondition(net.minecraft.world.item.ItemStack cost)
      Common condition for npcs and tm's so its in here so we have less repeat code.
      Parameters:
      cost - The item to be taken if the user accepts the move.
      Returns:
      A condition for use in addLearnMove(net.minecraft.server.level.ServerPlayer, java.util.UUID, com.pixelmonmod.pixelmon.battles.attacks.ImmutableAttack)
    • itemCostCondition

      public static Predicate<net.minecraft.server.level.ServerPlayer> itemCostCondition(Collection<net.minecraft.world.item.ItemStack> costs)
      Common condition for npcs and tm's so its in here so we have less repeat code.
      Parameters:
      costs - The items to be taken if the user accepts the move.
      Returns:
      A condition for use in addLearnMove(net.minecraft.server.level.ServerPlayer, java.util.UUID, com.pixelmonmod.pixelmon.battles.attacks.ImmutableAttack)