-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
265 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
src/main/java/com/artillexstudios/axrankmenu/utils/CommandMessages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package com.artillexstudios.axrankmenu.utils; | ||
|
||
import com.artillexstudios.axapi.utils.StringUtils; | ||
import revxrsal.commands.locales.LocaleReader; | ||
|
||
import java.util.Locale; | ||
|
||
import static com.artillexstudios.axrankmenu.AxRankMenu.CONFIG; | ||
import static com.artillexstudios.axrankmenu.AxRankMenu.LANG; | ||
|
||
public class CommandMessages implements LocaleReader { | ||
@Override | ||
public boolean containsKey(String s) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String get(String s) { | ||
String res; | ||
switch (s) { | ||
case "invalid-enum", "invalid-number", "invalid-uuid", "invalid-url", "invalid-boolean": { | ||
res = LANG.getString("commands.invalid-value") | ||
.replace("%value%", "{0}"); | ||
break; | ||
} | ||
case "missing-argument": { | ||
res = LANG.getString("commands.missing-argument") | ||
.replace("%value%", "{0}"); | ||
break; | ||
} | ||
case "no-permission": { | ||
res = LANG.getString("commands.no-permission"); | ||
break; | ||
} | ||
case "number-not-in-range": { | ||
res = LANG.getString("commands.out-of-range") | ||
.replace("%number%", "{0}") | ||
.replace("%min%", "{1}") | ||
.replace("%max%", "{2}"); | ||
break; | ||
} | ||
case "must-be-player": { | ||
res = LANG.getString("commands.player-only"); | ||
break; | ||
} | ||
case "must-be-console": { | ||
res = LANG.getString("commands.console-only"); | ||
break; | ||
} | ||
case "invalid-player": { | ||
res = LANG.getString("commands.invalid-player") | ||
.replace("%player%", "{0}"); | ||
break; | ||
} | ||
case "invalid-selector": { | ||
res = LANG.getString("commands.invalid-selector"); | ||
break; | ||
} | ||
default: { | ||
res = LANG.getString("commands.invalid-command"); | ||
break; | ||
} | ||
} | ||
return StringUtils.formatToString(CONFIG.getString("prefix", "") + res); | ||
} | ||
|
||
private final Locale locale = new Locale("en", "US"); | ||
|
||
@Override | ||
public Locale getLocale() { | ||
return locale; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/com/artillexstudios/axrankmenu/utils/ItemBuilderUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/artillexstudios/axrankmenu/utils/PlaceholderUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.