mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-20 23:21:19 +01:00
Update PointsData
If addPlayer is called with multiserver compatabillity, remove a player if it already exists to load from db. Make all addPlayer functions call up to one function.
This commit is contained in:
parent
6753f24876
commit
82620c0d01
@ -3,6 +3,7 @@ package com.gamingmesh.jobs.economy;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.container.PlayerPoints;
|
||||
|
||||
public class PointsData {
|
||||
@ -25,11 +26,11 @@ public class PointsData {
|
||||
}
|
||||
|
||||
public void addPlayer(UUID uuid, double points, double total) {
|
||||
if (!Pointbase.containsKey(uuid))
|
||||
Pointbase.put(uuid, new PlayerPoints(points, total));
|
||||
addPlayer(uuid, new PlayerPoints(points,total));
|
||||
}
|
||||
|
||||
public void addPlayer(UUID uuid, PlayerPoints points) {
|
||||
if (Jobs.getGCManager().MultiServerCompatability()&&Pointbase.containsKey(uuid)) Pointbase.remove(uuid);
|
||||
if (!Pointbase.containsKey(uuid))
|
||||
Pointbase.put(uuid, points);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user