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:
Claude committed 2026-01-04 08:23:50 +00:00
1 parent 7e6b17c106
commit 60b985d33d
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();
}
/**