mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 14:39:43 +00:00
Fix currency storage to use main PlayerData file
- Currency now stored in main player save file, not separate file - Currency excluded from getNBT/setNBT (slot-specific data) - Currency saved in save() after getNBT(), loaded before setNBT() - This ensures currency is preserved during profile slot changes - Removed loadCurrency() and saveCurrency() separate file methods - Updated VaultHelper to call save() instead of saveCurrency()
This commit is contained in:
2 files changed
+11
-64
No files matched your search
@@ -157,7 +157,7 @@ public class VaultHelper {
|
||||
PlayerData data = PlayerDataController.Instance.getPlayerData(player);
|
||||
boolean success = data.currencyData.deposit(amount);
|
||||
if (success) {
|
||||
data.saveCurrency();
|
||||
data.save();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -201,7 +201,7 @@ public class VaultHelper {
|
||||
PlayerData data = PlayerDataController.Instance.getPlayerData(player);
|
||||
boolean success = data.currencyData.withdraw(amount);
|
||||
if (success) {
|
||||
data.saveCurrency();
|
||||
data.save();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ public class VaultHelper {
|
||||
|
||||
PlayerData data = PlayerDataController.Instance.getPlayerData(player);
|
||||
data.currencyData.setBalance(amount);
|
||||
data.saveCurrency();
|
||||
data.save();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user