Deprecate SaneEconomy.getInstance()

This commit is contained in:
AppleDash 2017-07-17 16:11:58 -04:00
parent 9a00cddf24
commit 5ac6ba1407
4 changed files with 42 additions and 2 deletions

View File

@ -92,6 +92,32 @@
<outputDirectory>../out/</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>nexus-snapshots</serverId>
<nexusUrl>https://mvn.votuvo.com/</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>https://mvn.votuvo.com/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>

View File

@ -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;
}

View File

@ -55,7 +55,7 @@ public class BalanceTopCommand extends SaneCommand {
int offset = (page - 1) * nPerPage;
Map<OfflinePlayer, Double> topBalances = saneEconomy.getEconomyManager().getTopPlayerBalances(nPerPage, offset);
Map<OfflinePlayer, Double> 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)));
}
}

13
pom.xml
View File

@ -50,4 +50,17 @@
<version>0.3.2-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>