diff --git a/src/main/java/net/knarcraft/permissionsigns/container/PermissionSign.java b/src/main/java/net/knarcraft/permissionsigns/container/PermissionSign.java
index e2208ef..0e9bdd6 100644
--- a/src/main/java/net/knarcraft/permissionsigns/container/PermissionSign.java
+++ b/src/main/java/net/knarcraft/permissionsigns/container/PermissionSign.java
@@ -1,6 +1,5 @@
package net.knarcraft.permissionsigns.container;
-import net.knarcraft.permissionsigns.formatting.StringFormatter;
import net.knarcraft.permissionsigns.formatting.TranslatableMessage;
import net.knarcraft.permissionsigns.formatting.Translator;
import net.knarcraft.permissionsigns.manager.EconomyManager;
@@ -198,11 +197,7 @@ public class PermissionSign {
if (cost == 0) {
return Translator.getTranslatedMessage(TranslatableMessage.SIGN_COST_FREE);
} else {
- String currency = EconomyManager.getCurrency(cost != 1);
- String format = Translator.getTranslatedMessage(TranslatableMessage.SIGN_COST_FORMAT);
- String formatted = StringFormatter.replacePlaceholders(format, new String[]{"{cost}", "{currency}"},
- new String[]{"%.2f", currency});
- return String.format(formatted, cost);
+ return EconomyManager.format(cost);
}
}
diff --git a/src/main/java/net/knarcraft/permissionsigns/formatting/TranslatableMessage.java b/src/main/java/net/knarcraft/permissionsigns/formatting/TranslatableMessage.java
index ea27560..d39726d 100644
--- a/src/main/java/net/knarcraft/permissionsigns/formatting/TranslatableMessage.java
+++ b/src/main/java/net/knarcraft/permissionsigns/formatting/TranslatableMessage.java
@@ -70,11 +70,6 @@ public enum TranslatableMessage {
*/
SIGN_NAME_FORMAT,
- /**
- * The format for displaying the cost unit on a permission sign
- */
- SIGN_COST_FORMAT,
-
/**
* The format for displaying the duration on a permission sign
*/
diff --git a/src/main/java/net/knarcraft/permissionsigns/manager/EconomyManager.java b/src/main/java/net/knarcraft/permissionsigns/manager/EconomyManager.java
index f0b88ac..8dae776 100644
--- a/src/main/java/net/knarcraft/permissionsigns/manager/EconomyManager.java
+++ b/src/main/java/net/knarcraft/permissionsigns/manager/EconomyManager.java
@@ -36,17 +36,13 @@ public final class EconomyManager {
}
/**
- * Gets the name of the used currency
+ * Formats the given amount of currency according to the used economy plugin
*
- * @param plural Whether to get the plural name or the singular name
- * @return The name of the used currency
+ * @param amount The amount of currency to format
+ * @return The formatted amount of currency
*/
- public static String getCurrency(boolean plural) {
- if (plural) {
- return economy.currencyNamePlural();
- } else {
- return economy.currencyNameSingular();
- }
+ public static String format(double amount) {
+ return economy.format(amount);
}
/**
diff --git a/src/main/resources/strings.yml b/src/main/resources/strings.yml
index 3f29918..d657677 100644
--- a/src/main/resources/strings.yml
+++ b/src/main/resources/strings.yml
@@ -14,7 +14,6 @@ en:
SIGN_DURATION_FORMAT: "{duration} {unit}"
SIGN_PERMANENT: "Permanent"
SIGN_COST_FREE: "Free"
- SIGN_COST_FORMAT: "{cost}{currency}"
COST_INVALID_NUMBER: "&7The given cost is not a valid number"
DURATION_INVALID_NUMBER: "&7The given duration is not a valid number"
COMMAND_PLAYER_ONLY: "&7This command is only available to players"
@@ -58,7 +57,6 @@ nb-no:
SIGN_DURATION_FORMAT: "{duration} {unit}"
SIGN_PERMANENT: "Permanent"
SIGN_COST_FREE: "Gratis"
- SIGN_COST_FORMAT: "{cost}{currency}"
COST_INVALID_NUMBER: "&7Den gitte kostnaden er ikke et gyldig nummer"
DURATION_INVALID_NUMBER: "&7Den gitte varigheten er ikke et gyldig nummer"
COMMAND_PLAYER_ONLY: "&7Denne kommandoen kan bare brukes av spillere"