Class HoneypotPlayerManager
java.lang.Object
org.reprogle.honeypot.common.storagemanager.HoneypotPlayerManager
-
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 player) Gets the amount of Honeypots the player has broken.intgetCount(org.bukkit.OfflinePlayer player) Gets the amount of Honeypots the player has broken.static HoneypotPlayerManagerReturns the singleton instance of this classvoidsetPlayerCount(org.bukkit.entity.Player player, 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 player, 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:
player- The Player objectblocksBroken- The amount of blocks broken by the player
-
getCount
public int getCount(org.bukkit.entity.Player player) Gets the amount of Honeypots the player has broken. This is NOT the total, but rather the current amount until it loops to 0, based on the config- Parameters:
player- the Player object- Returns:
- The amount of Honeypot blocks the player has broken
-
getCount
public int getCount(org.bukkit.OfflinePlayer player) Gets the amount of Honeypots the player has broken. This is NOT the total, but rather the current amount until it loops to 0, based on the config- Parameters:
player- the Player name- Returns:
- The amount of Honeypot blocks the player has broken
-
deleteAllHoneypotPlayers
public void deleteAllHoneypotPlayers()Delete's all players in the DB
-