From 5ac6ba1407678f96d94a3a687118fc17ec0c052e Mon Sep 17 00:00:00 2001 From: AppleDash Date: Mon, 17 Jul 2017 16:11:58 -0400 Subject: [PATCH] Deprecate SaneEconomy.getInstance() --- SaneEconomyCore/pom.xml | 26 +++++++++++++++++++ .../appledash/saneeconomy/SaneEconomy.java | 1 + .../command/BalanceTopCommand.java | 4 +-- pom.xml | 13 ++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/SaneEconomyCore/pom.xml b/SaneEconomyCore/pom.xml index 5311238..60cb685 100644 --- a/SaneEconomyCore/pom.xml +++ b/SaneEconomyCore/pom.xml @@ -92,6 +92,32 @@ ../out/ + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + + + default-deploy + deploy + + deploy + + + + + nexus-snapshots + https://mvn.votuvo.com/ + true + + + + + + nexus-snapshots + https://mvn.votuvo.com/content/repositories/snapshots + + diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/SaneEconomy.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/SaneEconomy.java index 64ff207..924098f 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/SaneEconomy.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/SaneEconomy.java @@ -168,6 +168,7 @@ public class SaneEconomy extends SanePlugin implements ISaneEconomy { * Get the current plugin instance. * @return Instance */ + @Deprecated public static SaneEconomy getInstance() { return instance; } 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 1eacac7..74e4efe 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceTopCommand.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/command/BalanceTopCommand.java @@ -55,7 +55,7 @@ public class BalanceTopCommand extends SaneCommand { int offset = (page - 1) * nPerPage; - Map topBalances = saneEconomy.getEconomyManager().getTopPlayerBalances(nPerPage, offset); + Map topBalances = this.saneEconomy.getEconomyManager().getTopPlayerBalances(nPerPage, offset); if (topBalances.isEmpty()) { this.saneEconomy.getMessenger().sendMessage(sender, "There aren't enough players to display that page."); @@ -65,6 +65,6 @@ public class BalanceTopCommand extends SaneCommand { AtomicInteger index = new AtomicInteger(offset + 1); /* I know it's stupid, but you can't do some_int++ from within the lambda. */ this.saneEconomy.getMessenger().sendMessage(sender, "Top {1} players on page {2}:", topBalances.size(), page); - topBalances.forEach((player, balance) -> this.saneEconomy.getMessenger().sendMessage(sender, "[{1:02d}] {2} - {3}", index.getAndIncrement(), player.getName(), SaneEconomy.getInstance().getEconomyManager().getCurrency().formatAmount(balance))); + topBalances.forEach((player, balance) -> this.saneEconomy.getMessenger().sendMessage(sender, "[{1:02d}] {2} - {3}", index.getAndIncrement(), player.getName(), this.saneEconomy.getEconomyManager().getCurrency().formatAmount(balance))); } } diff --git a/pom.xml b/pom.xml index 25bcb88..82fda8e 100644 --- a/pom.xml +++ b/pom.xml @@ -50,4 +50,17 @@ 0.3.2-SNAPSHOT + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.7 + + true + + + +