Class HoneypotPlayerManager
java.lang.Object
org.reprogle.honeypot.storagemanager.HoneypotPlayerManager
A class for managing Honeypot players.
Adds functions for creating, setting counts, getting counts, and even
clearing out the DB.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlayer(org.bukkit.entity.Player player, int blocksBroken) Create a honeypot block by calling the SQLite DB.voidDelete's all players in the DBintgetCount(org.bukkit.entity.Player playerName) Return the amount of blocks the player has broken.static HoneypotPlayerManagerReturns the singleton instance of this classvoidsetPlayerCount(org.bukkit.entity.Player playerName, int blocksBroken) Set the number of blocks broken by the player by calling the SQLite setPlayerCount function.
-
Constructor Details
-
HoneypotPlayerManager
public HoneypotPlayerManager()
-
-
Method Details
-
getInstance
Returns the singleton instance of this class- Returns:
- The
HoneypotPlayerManagerinstance
-
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 objectblocksBroken- 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 objectblocksBroken- 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
-