mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-12 20:34:36 +01:00
Reset shop purchases each month
This commit is contained in:
@@ -829,6 +829,20 @@ public class Inventory extends PlayerManager implements GameDatabaseObject {
|
||||
return change.setSuccess(true);
|
||||
}
|
||||
|
||||
public void resetShopPurchases() {
|
||||
// Clear shop purchases if it's not empty
|
||||
if (!this.getShopBuyCount().isEmpty()) {
|
||||
this.getShopBuyCount().clear();
|
||||
Nebula.getGameDatabase().update(this, this.getUid(), "shopBuyCount", this.getShopBuyCount());
|
||||
}
|
||||
|
||||
// Clear mall purchases if it's not empty
|
||||
if (!this.getMallBuyCount().isEmpty()) {
|
||||
this.getMallBuyCount().clear();
|
||||
Nebula.getGameDatabase().update(this, this.getUid(), "mallBuyCount", this.getMallBuyCount());
|
||||
}
|
||||
}
|
||||
|
||||
// Database
|
||||
|
||||
public void loadFromDatabase() {
|
||||
|
||||
@@ -691,6 +691,11 @@ public class Player implements GameDatabaseObject {
|
||||
// Reset daily quests
|
||||
this.getQuestManager().resetDailyQuests();
|
||||
this.getBattlePassManager().getBattlePass().resetDailyQuests(resetWeekly);
|
||||
|
||||
// Reset monthly shop purchases
|
||||
if (resetMonthly) {
|
||||
this.getInventory().resetShopPurchases();
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger quests + achievements
|
||||
|
||||
Reference in New Issue
Block a user