Class MiniGamePlayer

java.lang.Object
com.minigameworld.frames.helpers.MiniGamePlayer
All Implemented Interfaces:
MiniGameRank, Cloneable, Comparable<MiniGameRank>

public class MiniGamePlayer extends Object implements MiniGameRank, Cloneable
Player data with score, live
[IMPORTANT] live is only valid in the minigame play (not related with player's health)
[IMPORTANT] Player state will be saved when a instance is created (in constructor)
  • Constructor Details

    • MiniGamePlayer

      public MiniGamePlayer(MiniGame minigame, org.bukkit.entity.Player p)
  • Method Details

    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Gets a player
      Returns:
      Player
    • isSamePlayer

      public boolean isSamePlayer(org.bukkit.entity.Player other)
      Check player are the same
      Parameters:
      other - Other player
      Returns:
      True if the same player
    • getScore

      public int getScore()
      Gets player's score
      Specified by:
      getScore in interface MiniGameRank
      Returns:
    • plusScore

      public void plusScore(int amount)
      Plus player's score
      Parameters:
      amount - Score amount
    • minusScore

      public void minusScore(int amount)
      Minus player's score
      Parameters:
      amount - Score amount
    • isLive

      public boolean isLive()
      Check player is live in the minigame play
      Returns:
      True if alive
    • setLive

      public void setLive(boolean live)
      Sets player's live in the minigame player
      This method will check MiniGame.checkGameFinishCondition()
      Parameters:
      live - False if make death a player
    • getState

      public MiniGamePlayerState getState()
      Gets player state instance
      Returns:
      MiniGamePlayerState
    • getPlayers

      public List<org.bukkit.entity.Player> getPlayers()
      Description copied from interface: MiniGameRank
      Gets rank players
      Specified by:
      getPlayers in interface MiniGameRank
      Returns:
      Players
    • clone

      public Object clone()
      Overrides:
      clone in class Object