Skip to content

Commit

Permalink
Closes #196
Browse files Browse the repository at this point in the history
  • Loading branch information
JustBru00 committed May 25, 2024
1 parent 5d0bfa0 commit 1a24b59
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.justbru00</groupId>
<artifactId>epicrename</artifactId>
<version>3.12</version>
<version>3.12.1-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
17 changes: 12 additions & 5 deletions src/com/gmail/justbru00/epic/rename/utils/v3/EconomyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,23 @@ public static EcoMessage takeMoney(Player player, EpicRenameCommands erc){
}

/**
* Formats the message with the {cost} and {error} varibles.
* @param msg The message you want to replace the varibles in.
* @param r The {@link EconomyResponse} that you want the varibles replace with.
* @return The formated string with the variibles replaced.
* Formats the message with the {cost} and {error} variables.
* @param msg The message you want to replace the variables in.
* @param r The {@link EconomyResponse} that you want the variables replace with.
* @return The formated string with the variables replaced.
*/
public static String formatMsg(String msg, EconomyResponse r) {

msg = msg.replace("{cost}", String.valueOf(r.amount));

if (!r.transactionSuccess()) msg = msg.replace("{error}", r.errorMessage);
if (!r.transactionSuccess()) {
if (r.errorMessage != null) {
msg = msg.replace("{error}", r.errorMessage);
} else {
msg = msg.replace("{error}", "Economy error message was null. Maybe try checking your balance?");
}
}

return msg;
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: EpicRename
main: com.gmail.justbru00.epic.rename.main.v3.Main
version: '3.12.1-INDEV'
version: '3.12.1-SNAPSHOT'
description: Performs different item modifications with easy to use commands.
authors: [Justin Brubaker,JustBru00,jayoevans]
softdepend: [Vault]
Expand Down

0 comments on commit 1a24b59

Please sign in to comment.