1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-18 13:21:41 +01:00

Lets save the jobs points after bought an item from jobs shop

This commit is contained in:
montlikadani 2020-02-23 10:31:19 +01:00
parent ea3cc04998
commit 2177261786
2 changed files with 10 additions and 3 deletions

View File

@ -258,6 +258,7 @@ public class ShopManager {
}
pointsInfo.takePoints(item.getPrice());
Jobs.getJobsDAO().savePoints(jPlayer);
player.sendMessage(Jobs.getLanguage().getMessage("command.shop.info.Paid", "%amount%", item.getPrice()));
}

View File

@ -91,20 +91,26 @@ public class JobsPlayer {
public void addPoints(Double points) {
getPointsData().addPoints(points);
Jobs.getJobsDAO().savePoints(this);
}
public void takePoints(Double points) {
getPointsData().takePoints(points);
Jobs.getJobsDAO().savePoints(this);
}
public void setPoints(Double points) {
getPointsData().setPoints(points);
Jobs.getJobsDAO().savePoints(this);
}
public void setPoints(PlayerPoints points) {
getPointsData().setPoints(points.getCurrentPoints());
getPointsData().setTotalPoints(points.getTotalPoints());
getPointsData().setNewEntry(points.isNewEntry());
PlayerPoints data = getPointsData();
data.setPoints(points.getCurrentPoints());
data.setTotalPoints(points.getTotalPoints());
data.setNewEntry(points.isNewEntry());
Jobs.getJobsDAO().savePoints(this);
}
public boolean havePoints(double points) {