From fe4fc5018d88b8be6195f68c3eeae4e434bb5790 Mon Sep 17 00:00:00 2001 From: AppleDash Date: Mon, 4 Nov 2019 12:08:24 -0500 Subject: [PATCH] Format code --- .../appledash/saneeconomy/SaneEconomy.java | 20 +++++++++-------- .../saneeconomy/command/BalanceCommand.java | 4 ++-- .../command/BalanceTopCommand.java | 6 ++--- .../command/EconomyAdminCommand.java | 22 +++++++++---------- .../saneeconomy/command/PayCommand.java | 10 ++++----- .../saneeconomy/command/SaneEcoCommand.java | 8 +++---- .../saneeconomy/economy/Currency.java | 10 ++++----- .../type/EconomyStorageBackendJSON.java | 12 +++++----- .../listeners/JoinQuitListener.java | 4 ++-- .../appledash/saneeconomy/utils/MapUtil.java | 2 +- .../utils/SaneEconomyConfiguration.java | 4 ++-- .../saneeconomy/vault/EconomySaneEconomy.java | 16 +++++++------- .../saneeconomy/test/EconomyManagerTest.java | 16 +++++++------- .../listeners/EntityDamageListener.java | 6 ++--- .../onlinetime/SaneEconomyOnlineTime.java | 2 +- .../listeners/SignChangeListener.java | 8 +++---- .../signshop/storage/SignShopStorageJSON.java | 2 +- .../util/LimitManager.java | 8 +++---- .../saneeconomysignshop/util/Pair.java | 2 +- astyle.conf | 9 ++++++++ 20 files changed, 91 insertions(+), 80 deletions(-) create mode 100644 astyle.conf diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/SaneEconomy.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/SaneEconomy.java index 7af33b5..ac7cb59 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/SaneEconomy.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/SaneEconomy.java @@ -36,13 +36,15 @@ public class SaneEconomy extends SanePlugin implements ISaneEconomy { private TransactionLogger transactionLogger; private GithubVersionChecker versionChecker; - private final Map COMMANDS = new HashMap() {{ - put("balance", new BalanceCommand(SaneEconomy.this)); - put("ecoadmin", new EconomyAdminCommand(SaneEconomy.this)); - put("pay", new PayCommand(SaneEconomy.this)); - put("saneeconomy", new SaneEcoCommand(SaneEconomy.this)); - put("balancetop", new BalanceTopCommand(SaneEconomy.this)); - }}; + private final Map COMMANDS = new HashMap() { + { + put("balance", new BalanceCommand(SaneEconomy.this)); + put("ecoadmin", new EconomyAdminCommand(SaneEconomy.this)); + put("pay", new PayCommand(SaneEconomy.this)); + put("saneeconomy", new SaneEcoCommand(SaneEconomy.this)); + put("balancetop", new BalanceTopCommand(SaneEconomy.this)); + } + }; public SaneEconomy() { instance = this; @@ -190,7 +192,7 @@ public class SaneEconomy extends SanePlugin implements ISaneEconomy { getLogger().info("Initialized listeners."); } - private void shutdown(){ + private void shutdown() { getServer().getPluginManager().disablePlugin(this); } @@ -229,7 +231,7 @@ public class SaneEconomy extends SanePlugin implements ISaneEconomy { * Get the logger for the plugin. * @return Plugin logger. */ - public static Logger logger(){ + public static Logger logger() { return instance.getLogger(); } diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceCommand.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceCommand.java index 1abb89f..9328330 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceCommand.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceCommand.java @@ -30,8 +30,8 @@ public class BalanceCommand extends SaneCommand { @Override public String[] getUsage() { return new String[] { - "/ [player]" - }; + "/ [player]" + }; } @Override diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceTopCommand.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceTopCommand.java index 1a38bea..5bc64e0 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceTopCommand.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceTopCommand.java @@ -31,9 +31,9 @@ public class BalanceTopCommand extends SaneCommand { @Override public String[] getUsage() { return new String[] { - "/", - "/ " - }; + "/", + "/ " + }; } @Override diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/EconomyAdminCommand.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/EconomyAdminCommand.java index 24ce346..c12d0c2 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/EconomyAdminCommand.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/EconomyAdminCommand.java @@ -39,8 +39,8 @@ public class EconomyAdminCommand extends SaneCommand { @Override public String[] getUsage() { return new String[] { - "/ [player] " - }; + "/ [player] " + }; } @Override @@ -92,7 +92,7 @@ public class EconomyAdminCommand extends SaneCommand { ecoMan.getCurrency().formatAmount(amount), sTargetPlayer, ecoMan.getCurrency().formatAmount(newAmount) - ); + ); if (this.saneEconomy.getConfig().getBoolean("economy.notify-admin-give") && targetPlayer.isOnline()) { this.saneEconomy.getMessenger().sendMessage((Player) targetPlayer, "{1} has given you {2}. Your balance is now {3}.", @@ -100,7 +100,7 @@ public class EconomyAdminCommand extends SaneCommand { ecoMan.getCurrency().formatAmount(amount), ecoMan.getCurrency().formatAmount(newAmount) - ); + ); } return; } @@ -115,7 +115,7 @@ public class EconomyAdminCommand extends SaneCommand { ecoMan.getCurrency().formatAmount(amount), sTargetPlayer, ecoMan.getCurrency().formatAmount(newAmount) - ); + ); if (this.saneEconomy.getConfig().getBoolean("economy.notify-admin-take") && targetPlayer.isOnline()) { this.saneEconomy.getMessenger().sendMessage((Player) targetPlayer, "{1} has taken {2} from you. Your balance is now {3}.", @@ -123,7 +123,7 @@ public class EconomyAdminCommand extends SaneCommand { ecoMan.getCurrency().formatAmount(amount), ecoMan.getCurrency().formatAmount(newAmount) - ); + ); } return; } @@ -137,13 +137,13 @@ public class EconomyAdminCommand extends SaneCommand { // FIXME: This is a silly hack to get it to log. if (oldBal.compareTo(BigDecimal.ZERO) > 0) { logger.logTransaction(new Transaction( - ecoMan.getCurrency(), economable, Economable.CONSOLE, oldBal, TransactionReason.ADMIN_TAKE - )); + ecoMan.getCurrency(), economable, Economable.CONSOLE, oldBal, TransactionReason.ADMIN_TAKE + )); } logger.logTransaction(new Transaction( - ecoMan.getCurrency(), Economable.CONSOLE, economable, amount, TransactionReason.ADMIN_GIVE - )); + ecoMan.getCurrency(), Economable.CONSOLE, economable, amount, TransactionReason.ADMIN_GIVE + )); }); if (this.saneEconomy.getConfig().getBoolean("economy.notify-admin-set") && targetPlayer.isOnline()) { @@ -151,7 +151,7 @@ public class EconomyAdminCommand extends SaneCommand { sender.getName(), ecoMan.getCurrency().formatAmount(amount) - ); + ); } return; diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/PayCommand.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/PayCommand.java index ae6f724..53689eb 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/PayCommand.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/PayCommand.java @@ -37,8 +37,8 @@ public class PayCommand extends SaneCommand { @Override public String[] getUsage() { return new String[] { - "/pay " - }; + "/pay " + }; } @Override @@ -84,7 +84,7 @@ public class PayCommand extends SaneCommand { this.saneEconomy.getMessenger().sendMessage(sender, "You do not have enough money to transfer {1} to {2}.", ecoMan.getCurrency().formatAmount(amount), sToPlayer - ); + ); return; } @@ -94,13 +94,13 @@ public class PayCommand extends SaneCommand { this.saneEconomy.getMessenger().sendMessage(sender, "You have transferred {1} to {2}.", ecoMan.getCurrency().formatAmount(amount), sToPlayer - ); + ); if (toPlayer.isOnline()) { this.saneEconomy.getMessenger().sendMessage(((CommandSender) toPlayer), "You have received {1} from {2}.", ecoMan.getCurrency().formatAmount(amount), fromPlayer.getDisplayName() - ); + ); } } } diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/SaneEcoCommand.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/SaneEcoCommand.java index fce23a4..0613ecf 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/SaneEcoCommand.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/SaneEcoCommand.java @@ -26,10 +26,10 @@ public class SaneEcoCommand extends SaneCommand { @Override public String[] getUsage() { return new String[] { - "/ reload - Reload everything.", - "/ reload-database - Reload the database.", - "/ reload-config - Reload the configuration." - }; + "/ reload - Reload everything.", + "/ reload-database - Reload the database.", + "/ reload-config - Reload the configuration." + }; } @Override diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/Currency.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/Currency.java index c40bcd4..826ec55 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/Currency.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/Currency.java @@ -63,11 +63,11 @@ public class Currency { } return new Currency( - config.getString("name.singular", "dollar"), - config.getString("name.plural", "dollars"), - format, - config.getString("balance-format", "{1} {2}") - ); + config.getString("name.singular", "dollar"), + config.getString("name.plural", "dollars"), + format, + config.getString("balance-format", "{1} {2}") + ); } /** diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/backend/type/EconomyStorageBackendJSON.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/backend/type/EconomyStorageBackendJSON.java index 6d78ca6..d395e20 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/backend/type/EconomyStorageBackendJSON.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/economy/backend/type/EconomyStorageBackendJSON.java @@ -40,13 +40,13 @@ public class EconomyStorageBackendJSON extends EconomyStorageBackendCaching { try { // try to load the old format and convert it // if that fails, load the new format - DataHolderOld dataHolder = gson.fromJson(new FileReader(file), DataHolderOld.class); - this.balances = new ConcurrentHashMap<>(); - this.uuidToName = new ConcurrentHashMap<>(dataHolder.uuidToName); + DataHolderOld dataHolder = gson.fromJson(new FileReader(file), DataHolderOld.class); + this.balances = new ConcurrentHashMap<>(); + this.uuidToName = new ConcurrentHashMap<>(dataHolder.uuidToName); - dataHolder.balances.forEach((s, bal) -> { - this.balances.put(s, new BigDecimal(bal)); - }); + dataHolder.balances.forEach((s, bal) -> { + this.balances.put(s, new BigDecimal(bal)); + }); this.saveDatabase(); } catch (FileNotFoundException e) { diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/listeners/JoinQuitListener.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/listeners/JoinQuitListener.java index f9e29c3..3da9f66 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/listeners/JoinQuitListener.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/listeners/JoinQuitListener.java @@ -36,8 +36,8 @@ public class JoinQuitListener implements Listener { /* A starting balance is configured AND they haven't been given it yet. */ if ((startBalance.compareTo(BigDecimal.ZERO) > 0) && !plugin.getEconomyManager().accountExists(economable)) { plugin.getEconomyManager().transact(new Transaction( - plugin.getEconomyManager().getCurrency(), Economable.CONSOLE, economable, startBalance, TransactionReason.STARTING_BALANCE - )); + plugin.getEconomyManager().getCurrency(), Economable.CONSOLE, economable, startBalance, TransactionReason.STARTING_BALANCE + )); if (plugin.getConfig().getBoolean("economy.notify-start-balance", true)) { this.plugin.getMessenger().sendMessage(player, "You've been issued a starting balance of {1}!", plugin.getEconomyManager().getCurrency().formatAmount(startBalance)); } diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/utils/MapUtil.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/utils/MapUtil.java index b474c38..bbb8a66 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/utils/MapUtil.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/utils/MapUtil.java @@ -10,7 +10,7 @@ public class MapUtil { /* Originally found on StackOverflow: http://stackoverflow.com/a/2581754/1849152 */ public static > LinkedHashMap sortByValue(Map map) { List> list = - new LinkedList<>(map.entrySet()); + new LinkedList<>(map.entrySet()); list.sort((o1, o2) -> -((o1.getValue()).compareTo(o2.getValue()))); diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/utils/SaneEconomyConfiguration.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/utils/SaneEconomyConfiguration.java index da96f56..66878d6 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/utils/SaneEconomyConfiguration.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/utils/SaneEconomyConfiguration.java @@ -156,7 +156,7 @@ public class SaneEconomyConfiguration { boolean useSsl = config.getBoolean("use_ssl", false); return new DatabaseCredentials( - databaseType, backendHost, backendPort, backendUser, backendPass, backendDb, tablePrefix, useSsl - ); + databaseType, backendHost, backendPort, backendUser, backendPass, backendDb, tablePrefix, useSsl + ); } } diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/vault/EconomySaneEconomy.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/vault/EconomySaneEconomy.java index e615ef4..016351d 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/vault/EconomySaneEconomy.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/vault/EconomySaneEconomy.java @@ -121,8 +121,8 @@ public class EconomySaneEconomy implements Economy { } return transact(new Transaction( - SaneEconomy.getInstance().getEconomyManager().getCurrency(), makeEconomable(target), Economable.PLUGIN, new BigDecimal(amount), TransactionReason.PLUGIN_TAKE - )); + SaneEconomy.getInstance().getEconomyManager().getCurrency(), makeEconomable(target), Economable.PLUGIN, new BigDecimal(amount), TransactionReason.PLUGIN_TAKE + )); } @Override @@ -136,8 +136,8 @@ public class EconomySaneEconomy implements Economy { } return transact(new Transaction( - SaneEconomy.getInstance().getEconomyManager().getCurrency(), Economable.wrap(offlinePlayer), Economable.PLUGIN, new BigDecimal(amount), TransactionReason.PLUGIN_TAKE - )); + SaneEconomy.getInstance().getEconomyManager().getCurrency(), Economable.wrap(offlinePlayer), Economable.PLUGIN, new BigDecimal(amount), TransactionReason.PLUGIN_TAKE + )); } @Override @@ -157,8 +157,8 @@ public class EconomySaneEconomy implements Economy { } return transact(new Transaction( - SaneEconomy.getInstance().getEconomyManager().getCurrency(), Economable.PLUGIN, makeEconomable(target), new BigDecimal(amount), TransactionReason.PLUGIN_GIVE - )); + SaneEconomy.getInstance().getEconomyManager().getCurrency(), Economable.PLUGIN, makeEconomable(target), new BigDecimal(amount), TransactionReason.PLUGIN_GIVE + )); } @Override @@ -168,8 +168,8 @@ public class EconomySaneEconomy implements Economy { } return transact(new Transaction( - SaneEconomy.getInstance().getEconomyManager().getCurrency(), Economable.PLUGIN, Economable.wrap(offlinePlayer), new BigDecimal(v), TransactionReason.PLUGIN_GIVE - )); + SaneEconomy.getInstance().getEconomyManager().getCurrency(), Economable.PLUGIN, Economable.wrap(offlinePlayer), new BigDecimal(v), TransactionReason.PLUGIN_GIVE + )); } @Override diff --git a/SaneEconomyCore/src/test/java/org/appledash/saneeconomy/test/EconomyManagerTest.java b/SaneEconomyCore/src/test/java/org/appledash/saneeconomy/test/EconomyManagerTest.java index aa28871..52d6346 100644 --- a/SaneEconomyCore/src/test/java/org/appledash/saneeconomy/test/EconomyManagerTest.java +++ b/SaneEconomyCore/src/test/java/org/appledash/saneeconomy/test/EconomyManagerTest.java @@ -29,8 +29,8 @@ public class EconomyManagerTest { @Before public void setupEconomyManager() { economyManager = new EconomyManager(new MockSaneEconomy(), - new Currency("test dollar", "test dollars", new DecimalFormat("0.00")), - new MockEconomyStorageBackend(), null); + new Currency("test dollar", "test dollars", new DecimalFormat("0.00")), + new MockEconomyStorageBackend(), null); } @Test @@ -63,16 +63,16 @@ public class EconomyManagerTest { // Ensure that balance addition and subtraction works... Assert.assertEquals(new BigDecimal("25.00"), economyManager.transact( - new Transaction(economyManager.getCurrency(), playerOne, Economable.CONSOLE, new BigDecimal("25.00"), TransactionReason.TEST_TAKE) - ).getFromBalance()); + new Transaction(economyManager.getCurrency(), playerOne, Economable.CONSOLE, new BigDecimal("25.00"), TransactionReason.TEST_TAKE) + ).getFromBalance()); Assert.assertEquals(new BigDecimal("50.00"), economyManager.transact( - new Transaction(economyManager.getCurrency(), Economable.CONSOLE, playerOne, new BigDecimal("25.00"), TransactionReason.TEST_GIVE) - ).getToBalance()); + new Transaction(economyManager.getCurrency(), Economable.CONSOLE, playerOne, new BigDecimal("25.00"), TransactionReason.TEST_GIVE) + ).getToBalance()); Assert.assertEquals(TransactionResult.Status.ERR_NOT_ENOUGH_FUNDS, economyManager.transact( - new Transaction(economyManager.getCurrency(), playerTwo, Economable.CONSOLE, new BigDecimal(Double.MAX_VALUE), TransactionReason.TEST_TAKE) - ).getStatus()); + new Transaction(economyManager.getCurrency(), playerTwo, Economable.CONSOLE, new BigDecimal(Double.MAX_VALUE), TransactionReason.TEST_TAKE) + ).getStatus()); // Ensure that hasBalance works Assert.assertTrue(economyManager.hasBalance(playerOne, new BigDecimal("50.00"))); diff --git a/SaneEconomyMobKills/src/main/java/org/appledash/saneeconomymobkills/listeners/EntityDamageListener.java b/SaneEconomyMobKills/src/main/java/org/appledash/saneeconomymobkills/listeners/EntityDamageListener.java index 2ec0c70..7a94a4c 100644 --- a/SaneEconomyMobKills/src/main/java/org/appledash/saneeconomymobkills/listeners/EntityDamageListener.java +++ b/SaneEconomyMobKills/src/main/java/org/appledash/saneeconomymobkills/listeners/EntityDamageListener.java @@ -87,10 +87,10 @@ public class EntityDamageListener implements Listener { } plugin.getSaneEconomy().getEconomyManager().transact(new Transaction( - this.plugin.getSaneEconomy().getEconomyManager().getCurrency(), Economable.PLUGIN, Economable.wrap(offlinePlayer), thisAmount, TransactionReason.PLUGIN_GIVE - )); + this.plugin.getSaneEconomy().getEconomyManager().getCurrency(), Economable.PLUGIN, Economable.wrap(offlinePlayer), thisAmount, TransactionReason.PLUGIN_GIVE + )); } - + damageDealt.remove(evt.getEntity().getEntityId()); } diff --git a/SaneEconomyOnlineTime/src/main/java/org/appledash/saneeconomy/onlinetime/SaneEconomyOnlineTime.java b/SaneEconomyOnlineTime/src/main/java/org/appledash/saneeconomy/onlinetime/SaneEconomyOnlineTime.java index 552afa3..29824f4 100644 --- a/SaneEconomyOnlineTime/src/main/java/org/appledash/saneeconomy/onlinetime/SaneEconomyOnlineTime.java +++ b/SaneEconomyOnlineTime/src/main/java/org/appledash/saneeconomy/onlinetime/SaneEconomyOnlineTime.java @@ -62,7 +62,7 @@ public class SaneEconomyOnlineTime extends SanePlugin implements Listener { } } - },0, 20); + }, 0, 20); this.getServer().getPluginManager().registerEvents(this, this); } diff --git a/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/listeners/SignChangeListener.java b/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/listeners/SignChangeListener.java index a66dda0..8e91bb5 100644 --- a/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/listeners/SignChangeListener.java +++ b/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/listeners/SignChangeListener.java @@ -52,14 +52,14 @@ public class SignChangeListener implements Listener { if (signShop.canBuy()) { // The player be buying from the shop, not the other way around. this.plugin.getMessenger().sendMessage(evt.getPlayer(), "Will sell to players for {1}.", - plugin.getSaneEconomy().getEconomyManager().getCurrency().formatAmount(signShop.getBuyPrice()) - ); + plugin.getSaneEconomy().getEconomyManager().getCurrency().formatAmount(signShop.getBuyPrice()) + ); } if (signShop.canSell()) { // The player be selling to the shop, not the other way around. this.plugin.getMessenger().sendMessage(evt.getPlayer(), "Will buy from players for {1}.", - plugin.getSaneEconomy().getEconomyManager().getCurrency().formatAmount(signShop.getSellPrice()) - ); + plugin.getSaneEconomy().getEconomyManager().getCurrency().formatAmount(signShop.getSellPrice()) + ); } } diff --git a/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/signshop/storage/SignShopStorageJSON.java b/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/signshop/storage/SignShopStorageJSON.java index c59e0d0..20ef203 100644 --- a/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/signshop/storage/SignShopStorageJSON.java +++ b/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/signshop/storage/SignShopStorageJSON.java @@ -34,7 +34,7 @@ public class SignShopStorageJSON implements SignShopStorage { } try { - List tempShops = gson.fromJson(new FileReader(storageFile), new TypeToken>(){}.getType()); + List tempShops = gson.fromJson(new FileReader(storageFile), new TypeToken>() {} .getType()); tempShops.forEach((shop) -> cachedSignShops.put(shop.getLocation(), shop)); } catch (FileNotFoundException e) { throw new IllegalStateException("This shouldn't happen - the file " + storageFile.getAbsolutePath() + " disappeared while we were trying to read it!", e); diff --git a/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/util/LimitManager.java b/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/util/LimitManager.java index efa68bc..101f0e6 100644 --- a/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/util/LimitManager.java +++ b/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/util/LimitManager.java @@ -60,15 +60,15 @@ public class LimitManager { public void incrementLimitsHourly() { // For every limit type - // For every player - // For every limit - // Increment limit by the limit for the specific direction and item. + // For every player + // For every limit + // Increment limit by the limit for the specific direction and item. sellPlayerLimits.forEach((playerUuid, itemToLimit) -> { Map newLimits = new HashMap<>(); itemToLimit.forEach((itemInfo, currentLimit) -> - newLimits.put(itemInfo, currentLimit + (sellItemLimits.get(itemInfo).getHourlyGain()))); + newLimits.put(itemInfo, currentLimit + (sellItemLimits.get(itemInfo).getHourlyGain()))); itemToLimit.putAll(newLimits); }); diff --git a/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/util/Pair.java b/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/util/Pair.java index 47ddbbd..2ebefdc 100644 --- a/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/util/Pair.java +++ b/SaneEconomySignShop/src/main/java/org/appledash/saneeconomysignshop/util/Pair.java @@ -24,4 +24,4 @@ public class Pair { public static Pair of(K k, V v) { return new Pair<>(k, v); } -} \ No newline at end of file +} diff --git a/astyle.conf b/astyle.conf new file mode 100644 index 0000000..a82ad1b --- /dev/null +++ b/astyle.conf @@ -0,0 +1,9 @@ +--mode=java +--style=java # Bracket formatting +--indent=spaces=4 +--indent-switches +--pad-oper +--pad-header +--add-brackets +--suffix=none # Do not backup original file +--lineend=linux