1
0
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:
jackstrosahl 2019-02-06 01:46:31 -06:00
parent 6753f24876
commit 82620c0d01

View File

@ -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);
}