Class StatusPersist

Direct Known Subclasses:
Burn, Drowsy, Freeze, Frostbite, NoStatus, Paralysis, Poison, Sleep

public abstract class StatusPersist extends StatusBase
A status that remains after switching out.
  • Constructor Details

    • StatusPersist

      public StatusPersist(StatusType type)
      Initializes the status.
      Parameters:
      type - The status's type.
  • Method Details

    • writeToNBT

      public void writeToNBT(net.minecraft.nbt.CompoundTag nbt)
      Writes the status to NBT.
      Parameters:
      nbt - The NBT tag to write to.
    • restoreFromNBT

      public abstract StatusPersist restoreFromNBT(net.minecraft.nbt.CompoundTag nbt)
      Loads the status from NBT.
      Parameters:
      nbt - The NBT tag to read from.
      Returns:
      A new instance of the status.
    • readStatusFromNBT

      public static StatusPersist readStatusFromNBT(net.minecraft.nbt.CompoundTag nbt)
      Reads the Pokémon's status from NBT.
      Parameters:
      nbt - The NBT tag to read from.
      Returns:
      The status read from NBT.
    • addStatus

      protected boolean addStatus(PixelmonWrapper user, PixelmonWrapper target, Attack attack, boolean showMessage, String alreadyMessage, String addMessage)
      Adds the status to the target if possible.
      Parameters:
      user - The Pokémon causing the status.
      target - The Pokémon to add the status to.
      attack - The move causing the status.
      showMessage - Whether to show messages depending on what occurs.
      alreadyMessage - The message to show if the target already has the status.
      addMessage - The message to show if the status is added successfully.
      Returns:
      Whether the status was afflicted successfully.
    • isStatus

      public boolean isStatus(StatusType type)
    • alreadyHasStatus

      protected boolean alreadyHasStatus(PixelmonWrapper pw)
      Checks if the Pokémon already has the status.
      Parameters:
      pw - The Pokémon to check.
      Returns:
      Whether the Pokémon already has the status.