Class HoneypotPlayerManager

java.lang.Object
org.reprogle.honeypot.storagemanager.HoneypotPlayerManager

public class HoneypotPlayerManager extends Object
A class for managing Honeypot players. Adds functions for creating, setting counts, getting counts, and even clearing out the DB.
See Also:
  • Constructor Details

    • HoneypotPlayerManager

      public HoneypotPlayerManager()
  • Method Details

    • getInstance

      public static HoneypotPlayerManager getInstance()
      Returns the singleton instance of this class
      Returns:
      The HoneypotPlayerManager instance
    • addPlayer

      public void addPlayer(org.bukkit.entity.Player player, int blocksBroken)
      Create a honeypot block by calling the SQLite DB. In the future this will be a switch case statement to handle multiple DB types
      Parameters:
      player - The Player object
      blocksBroken - The amount of Blocks broken
    • setPlayerCount

      public void setPlayerCount(org.bukkit.entity.Player playerName, int blocksBroken)
      Set the number of blocks broken by the player by calling the SQLite setPlayerCount function. In the future this will be a switch case statement to handle multiple DB types without changing code
      Parameters:
      playerName - The Player object
      blocksBroken - The amount of blocks broken by the player
    • getCount

      public int getCount(org.bukkit.entity.Player playerName)
      Return the amount of blocks the player has broken. If it returns -1, then the player doesn't exist in the DB yet (They haven't broken any Honeypots)
      Parameters:
      playerName - the Player name
      Returns:
      The amount of Honeypot blocks the player has broken
    • deleteAllHoneypotPlayers

      public void deleteAllHoneypotPlayers()
      Delete's all players in the DB