Class CaptureHealth

java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.catching.CaptureHealth

public class CaptureHealth extends Object
Class for storing health values and Pokémon references for capture calculation purposes.
  • Constructor Details

    • CaptureHealth

      public CaptureHealth(@Nonnull PixelmonEntity entity)
      Constructs a new CaptureHealth representing a regular capture (in battle or out of battle, not a raid).
      Parameters:
      entity - The PixelmonEntity being caught.
    • CaptureHealth

      public CaptureHealth(@Nonnull RaidData.RaidPlayer raidPlayer, @Nonnull RaidData raid)
      Constructs a new CaptureHealth representing a raid capture.
      Parameters:
      raidPlayer - The RaidData.RaidPlayer instance performing this capture.
      raid - The RaidData this capture is part of.
  • Method Details

    • getCurrentHP

      public double getCurrentHP()
      Gets the current HP for the purposes of the capture attempt this object is associated with.
      Returns:
      The current HP value.
    • getMaxHP

      public double getMaxHP()
      Gets the max HP for the purposes of the capture attempt this object is associated with.
      Returns:
      The max HP value.
    • hasEntity

      public boolean hasEntity()
      Whether there is a PixelmonEntity associated with the capture attempt this object is associated with.
      Returns:
      Whether there is a PixelmonEntity associated with the capture attempt this object is associated with.
    • getEntity

      @Nullable public PixelmonEntity getEntity()
      Gets the PixelmonEntity associated with the capture attempt this object is associated with.
      Returns:
      The PixelmonEntity for the capture attempt this object is associated with.
    • hasWrapper

      public boolean hasWrapper()
      Whether there is a PixelmonWrapper associated with the capture attempt this object is associated with.
      Returns:
      Whether there is a PixelmonWrapper associated with the capture attempt this object is associated with.
    • getWrapper

      @Nullable public PixelmonWrapper getWrapper()
      Gets the PixelmonWrapper associated with the capture attempt this object is associated with.
      Returns:
      The PixelmonWrapper for the capture attempt this object is associated with.
    • isRaid

      public boolean isRaid()
      Whether there is a RaidData and RaidData.RaidPlayer associated with the capture attempt this object is associated with.
      Returns:
      Whether there is a RaidData and RaidData.RaidPlayer associated with the capture attempt this object is associated with.
    • getRaidPlayer

      @Nullable public RaidData.RaidPlayer getRaidPlayer()
      Gets the RaidData.RaidPlayer associated with the capture attempt this object is associated with.
      Returns:
      The RaidData.RaidPlayer for the capture attempt this object is associated with.
    • getRaid

      @Nullable public RaidData getRaid()
      Gets the RaidData associated with the capture attempt this object is associated with.
      Returns:
      The RaidData for the capture attempt this object is associated with.