Class KnockdownManager

java.lang.Object
stawa.vitalstrike.systems.KnockdownManager

public class KnockdownManager extends Object
Manages the knockdown system in VitalStrike, handling player states when they are downed in combat. This system allows players to be temporarily incapacitated instead of dying instantly, giving teammates a chance to revive them or allowing self-revival with special items.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes the KnockdownManager with configuration settings from the plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    attemptSelfRevive(org.bukkit.entity.Player player)
    Attempts to initiate a self-revival process for a downed player using a Vital Awakening item.
    void
    cancelSelfRevive(org.bukkit.entity.Player player)
    Cancels an ongoing self-revival attempt for a player.
    void
    Performs cleanup of all active knockdown-related tasks and resources.
    void
    handlePlayerDeath(org.bukkit.entity.Player player)
    Handles the knockdown state when a player would normally die.
    void
    handlePlayerJoin(org.bukkit.entity.Player player)
    Handles necessary state updates when a player joins the server.
    boolean
    isPlayerDowned(org.bukkit.entity.Player player)
    Checks if a player is currently in a downed state.
    void
    startRevive(org.bukkit.entity.Player reviver, org.bukkit.entity.Player target)
    Initiates the revival process for a downed player by another player.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • attemptSelfRevive

      public void attemptSelfRevive(org.bukkit.entity.Player player)
      Attempts to initiate a self-revival process for a downed player using a Vital Awakening item. If instant use is enabled, the revival happens immediately. Otherwise, it starts a progress bar.
      Parameters:
      player - The player attempting to self-revive
    • cancelSelfRevive

      public void cancelSelfRevive(org.bukkit.entity.Player player)
      Cancels an ongoing self-revival attempt for a player. Cleans up associated tasks and progress bars.
      Parameters:
      player - The player whose self-revival attempt should be cancelled
    • cleanup

      public void cleanup()
      Performs cleanup of all active knockdown-related tasks and resources. This should be called when the plugin is being disabled or reloaded.
    • handlePlayerDeath

      public void handlePlayerDeath(org.bukkit.entity.Player player)
      Handles the knockdown state when a player would normally die. Sets up the downed state, effects, and countdown timer.
      Parameters:
      player - The player entering the knockdown state
    • handlePlayerJoin

      public void handlePlayerJoin(org.bukkit.entity.Player player)
      Handles necessary state updates when a player joins the server. Ensures knockdown states are properly maintained across reconnects.
      Parameters:
      player - The player who joined the server
    • startRevive

      public void startRevive(org.bukkit.entity.Player reviver, org.bukkit.entity.Player target)
      Initiates the revival process for a downed player by another player. Creates a progress bar and starts the revival countdown.
      Parameters:
      reviver - The player attempting to revive the downed player
      target - The downed player being revived
    • isPlayerDowned

      public boolean isPlayerDowned(org.bukkit.entity.Player player)
      Checks if a player is currently in a downed state.
      Parameters:
      player - The player to check
      Returns:
      true if the player is downed, false otherwise