Added getters for stats/StatsManager.java
This commit is contained in:
parent
e054b06cc2
commit
69fa9eaba5
@ -109,6 +109,27 @@ public class StatsManager extends MiniPlugin
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getStat(Player player, String table, String statName)
|
||||||
|
{
|
||||||
|
getStat(player.getName(), table, statName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStat(String playerName, String table, String statName)
|
||||||
|
{
|
||||||
|
if (!_playerStatList.containsKey(table))
|
||||||
|
{
|
||||||
|
System.out.println("Error getting stats for " + playerName + " on table " + table + " (" + statName + ") : TABLE DOES NOT EXIST!");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_playerStatList.get(table).containsKey(playerName))
|
||||||
|
{
|
||||||
|
_playerStatList.get(table).put(playerName, new PlayerStats());
|
||||||
|
}
|
||||||
|
|
||||||
|
return _playerStatList.get(table).get(playerName).getStat(statName);
|
||||||
|
}
|
||||||
|
|
||||||
public void addStat(Player player, String table, String statName, int value)
|
public void addStat(Player player, String table, String statName, int value)
|
||||||
{
|
{
|
||||||
addStat(player.getName(), table, statName, value);
|
addStat(player.getName(), table, statName, value);
|
||||||
|
Loading…
Reference in New Issue
Block a user