Skip to content

Commit

Permalink
Merge pull request #54 from BentoBoxWorld/develop
Browse files Browse the repository at this point in the history
Version 1.19.0
  • Loading branch information
tastybento authored Nov 17, 2024
2 parents 9caa615 + f216902 commit f03267e
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 18 deletions.
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@
</issueManagement>

<distributionManagement>
<snapshotRepository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.org/repository/maven-snapshots</url>
</snapshotRepository>
<repository>
<id>codemc-releases</id>
<url>https://repo.codemc.org/repository/maven-releases</url>
<id>bentoboxworld</id>
<url>https://repo.codemc.org/repository/bentoboxworld/</url>
</repository>
</distributionManagement>

Expand All @@ -59,14 +55,14 @@
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.20.6-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.5.4</bentobox.version>
<spigot.version>1.21.3-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.8.0</build.version>
<build.version>1.9.0</build.version>
<sonar.projectKey>BentoBoxWorld_Bank</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
Expand Down Expand Up @@ -119,6 +115,10 @@
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<repository>
<id>bentoboxworld</id>
<url>https://repo.codemc.org/repository/bentoboxworld/</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/world/bentobox/bank/PhManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@
*/
public class PhManager {
private static final BigInteger THOUSAND = BigInteger.valueOf(1000);
private static final TreeMap<BigInteger, String> LEVELS;
static {
LEVELS = new TreeMap<>();

LEVELS.put(THOUSAND, "k");
LEVELS.put(THOUSAND.pow(2), "M");
LEVELS.put(THOUSAND.pow(3), "G");
LEVELS.put(THOUSAND.pow(4), "T");
}
private static final TreeMap<BigInteger, String> LEVELS = new TreeMap<>();

private final BentoBox plugin;
private final BankManager bankManager;
Expand All @@ -49,6 +41,10 @@ public PhManager(Bank addon, BankManager bankManager) {
this.addon = addon;
this.plugin = addon.getPlugin();
this.bankManager = bankManager;
LEVELS.put(THOUSAND, addon.getSettings().getKilo());
LEVELS.put(THOUSAND.pow(2), addon.getSettings().getMega());
LEVELS.put(THOUSAND.pow(3), addon.getSettings().getGiga());
LEVELS.put(THOUSAND.pow(4), addon.getSettings().getTera());
}

protected boolean registerPlaceholders(GameModeAddon gm) {
Expand Down
65 changes: 65 additions & 0 deletions src/main/java/world/bentobox/bank/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ public class Settings implements ConfigObject {
@ConfigComment("from the bank?")
private boolean sendBankAlert = true;

@ConfigComment("Shorthand units")
@ConfigEntry(path = "units.kilo")
private String kilo = "k";
@ConfigEntry(path = "units.mega")
private String mega = "M";
@ConfigEntry(path = "units.giga")
private String giga = "G";
@ConfigEntry(path = "units.tera")
private String tera = "T";

/**
* @return the gameModes
Expand Down Expand Up @@ -187,4 +196,60 @@ public int getCooldown() {
public void setCooldown(int cooldown) {
this.cooldown = cooldown;
}

/**
* @return the kilo
*/
public String getKilo() {
return kilo;
}

/**
* @param kilo the kilo to set
*/
public void setKilo(String kilo) {
this.kilo = kilo;
}

/**
* @return the mega
*/
public String getMega() {
return mega;
}

/**
* @param mega the mega to set
*/
public void setMega(String mega) {
this.mega = mega;
}

/**
* @return the giga
*/
public String getGiga() {
return giga;
}

/**
* @param giga the giga to set
*/
public void setGiga(String giga) {
this.giga = giga;
}

/**
* @return the tera
*/
public String getTera() {
return tera;
}

/**
* @param tera the tera to set
*/
public void setTera(String tera) {
this.tera = tera;
}
}
6 changes: 6 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ bank:
# Cooldown time for user withdrawl and deposit commands. This should be set long enought
# so that database writes can be made in time. Default is 60 seconds.
cooldown: 60
units:
# Shorthand units
kilo: k
mega: M
giga: G
tera: T

0 comments on commit f03267e

Please sign in to comment.