Skip to content

Commit 6107c9c

Browse files
committed
1.10 - 1.21.3 support
Took 6 minutes
1 parent 8eb6741 commit 6107c9c

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

buildNumber.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#maven.buildNumber.plugin properties file
2-
#Wed Aug 14 11:56:47 EDT 2024
3-
buildNumber=356
2+
#Mon Nov 04 12:18:26 EST 2024
3+
buildNumber=363

pom.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
<name>Funds</name>
1010
<description>The ultimate custom currency plugin</description>
11-
<version>1.9.4</version>
11+
<version>1.10.0</version>
1212
<packaging>jar</packaging>
1313

1414
<properties>
1515
<author>Kiran Hart</author>
1616
<jarName>${project.name}</jarName>
1717
<main.class>${project.groupId}.${project.artifactId}.${project.name}</main.class>
1818
<java.version>16</java.version>
19-
<flight.version>3.24.1</flight.version>
19+
<flight.version>3.28.0</flight.version>
2020
<flight.path>ca.tweetzy</flight.path>
2121
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2222
</properties>
@@ -191,6 +191,24 @@
191191
</execution>
192192
</executions>
193193
</plugin>
194+
<plugin>
195+
<groupId>com.coderplus.maven.plugins</groupId>
196+
<artifactId>copy-rename-maven-plugin</artifactId>
197+
<version>1.0.1</version>
198+
<executions>
199+
<execution>
200+
<id>copy-named-jar</id>
201+
<phase>package</phase>
202+
<goals>
203+
<goal>copy</goal>
204+
</goals>
205+
<configuration>
206+
<sourceFile>${project.build.directory}/${project.name}.jar</sourceFile>
207+
<destinationFile>D:\Development\Spigot Plugins\Ready Jars\${project.name}\${project.name} - v${project.version}.jar</destinationFile>
208+
</configuration>
209+
</execution>
210+
</executions>
211+
</plugin>
194212
</plugins>
195213
<resources>
196214
<resource>

src/main/java/ca/tweetzy/funds/hooks/PlaceholderAPIHook.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package ca.tweetzy.funds.hooks;
22

33
import ca.tweetzy.funds.Funds;
4+
import ca.tweetzy.funds.api.interfaces.Account;
5+
import ca.tweetzy.funds.api.interfaces.Currency;
46
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
57
import org.bukkit.OfflinePlayer;
68
import org.jetbrains.annotations.NotNull;
@@ -46,6 +48,22 @@ String onRequest(OfflinePlayer player, @NotNull String params) {
4648
if (params.equalsIgnoreCase("total_accounts"))
4749
return String.valueOf(Funds.getAccountManager().getAccounts().size());
4850

51+
final String[] paramSplit = params.split("_");
52+
if (paramSplit.length >= 2) {
53+
final Currency currency = Funds.getCurrencyManager().getCurrency(paramSplit[0]);
54+
if (currency == null) return "0";
55+
56+
final Account account = Funds.getAccountManager().getAccount(player);
57+
if (account == null) return "0";
58+
59+
return switch (paramSplit[1].toLowerCase()) {
60+
case "pluralname" -> currency.getPluralFormat();
61+
case "singlename" -> currency.getSingularFormat();
62+
case "balance" -> String.valueOf(account.getCurrencies().get(currency));
63+
default -> null;
64+
};
65+
}
66+
4967
return null;
5068
}
5169
}

0 commit comments

Comments
 (0)