Skip to content

Commit

Permalink
economy overhaul first commit
Browse files Browse the repository at this point in the history
Replace Government economy calls to use OfflinePlayer
Replace Player Account calls to use UUID
Make ReserveAdapter use UUIDs
Make VaultAdapter use OfflinePlayer
Converts town & nation accounts

TODO: convert server_account and war_spoils
TODO: major cleanup and removal of redundancies
economy overhaul second commit

First round of cleanup of everything.
Javadoc comments.
Add warchest and serveraccount to conversion.
economy overhaul third commit

Town/Nations BankAccounts work.
Towny-Server & WarChest accounts convert and work.
Resident accounts do not work.
economy overhaul fourth commit

this was a terrible idea
economy overhaul fifth commit

All account types convert.
Testing required but it appears to work.
Whitespacing cleanup commit.
Change from using deprecated method.
Revert change in last commit.
  • Loading branch information
LlmDl committed Nov 1, 2021
1 parent b11daf8 commit 17dde84
Show file tree
Hide file tree
Showing 22 changed files with 1,118 additions and 421 deletions.
5 changes: 5 additions & 0 deletions resources/legacyAccountsConverted.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
If this file doesn't exist (you delete it),
Towny will automatically attempt to convert
old bank accounts.

99% of servers can leave this file alone.
4 changes: 4 additions & 0 deletions src/com/palmergames/bukkit/towny/Towny.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ private void checkPlugins() {
File f = new File(TownyUniverse.getInstance().getRootFolder(), "debtAccountsConverted.txt"); // For a short time Towny stored debt accounts in the server's
if (!f.exists()) // economy plugin. This practice had to end, being replaced
Bukkit.getScheduler().runTaskLaterAsynchronously(this, () -> MoneyUtil.convertLegacyDebtAccounts(), 600l); // with the debtBalance which is stored in the Town object.

f = new File(TownyUniverse.getInstance().getRootFolder(), "legacyAccountsConverted.txt");
if (!f.exists())
Bukkit.getScheduler().runTaskLaterAsynchronously(this, () -> MoneyUtil.convertLegacyBankAccounts(), 600l);

} else {
ecowarn = "Warning: No compatible Economy plugins found. Install Vault.jar or Reserve.jar with any of the supported eco systems. If you do not want an economy to be used, set using_economy: false in your Towny config.yml.";
Expand Down
Loading

0 comments on commit 17dde84

Please sign in to comment.