@@ -185,7 +185,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
185185 : (bukkitCmd != null ? bukkitCmd .getName () : null );
186186
187187 if (usedLabel == null || usedLabel .isEmpty ()) {
188- String msg = language .getFormatted (
188+ String msg = language .getString (
189189 KEY_UNKNOWN_COMMAND ,
190190 FMT_UNKNOWN_COMMAND ,
191191 ""
@@ -196,7 +196,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
196196
197197 CommandRegistry cmd = getCommand (usedLabel ).orElse (null );
198198 if (cmd == null ) {
199- String msg = language .getFormatted (
199+ String msg = language .getString (
200200 KEY_UNKNOWN_COMMAND ,
201201 FMT_UNKNOWN_COMMAND ,
202202 usedLabel
@@ -207,7 +207,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
207207
208208 if (!isCommandVisible (player , cmd )) {
209209 // Intentionally pretend the command does not exist for this group
210- String msg = language .getFormatted (
210+ String msg = language .getString (
211211 KEY_UNKNOWN_COMMAND ,
212212 FMT_UNKNOWN_COMMAND ,
213213 usedLabel
@@ -220,7 +220,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
220220 if (!isModuleEnabled (cmd .getModuleName ())) {
221221 player .msg (
222222 NamedTextColor .RED ,
223- language .getFormatted (
223+ language .getString (
224224 KEY_MODULE_DISABLED ,
225225 FMT_MODULE_DISABLED ,
226226 usedLabel .toLowerCase (Locale .ROOT )
@@ -233,7 +233,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
233233 if (!cmd .isEnabled ()) {
234234 player .msg (
235235 NamedTextColor .RED ,
236- language .getFormatted (
236+ language .getString (
237237 KEY_COMMAND_DISABLED ,
238238 FMT_COMMAND_DISABLED ,
239239 usedLabel .toLowerCase (Locale .ROOT )
@@ -244,7 +244,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
244244
245245 // Permission check
246246 if (cmd .hasPermissionNode () && !player .hasPermission (cmd .getPermissionNode ())) {
247- String noPerm = language .get (KEY_NO_PERMISSION , MSG_NO_PERMISSION );
247+ String noPerm = language .getString (KEY_NO_PERMISSION , MSG_NO_PERMISSION );
248248 player .msg (NamedTextColor .RED , noPerm );
249249 return true ;
250250 }
@@ -257,7 +257,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
257257
258258 player .msg (
259259 NamedTextColor .RED ,
260- language .getFormatted (
260+ language .getString (
261261 KEY_INSUFFICIENT_FUNDS ,
262262 FMT_INSUFFICIENT_FUNDS ,
263263 formatted ,
@@ -272,7 +272,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
272272 double remaining = cooldownManager .getRemaining (player .getUuid (), cmd );
273273 player .msg (
274274 NamedTextColor .RED ,
275- language .getFormatted (
275+ language .getString (
276276 KEY_COOLDOWN_ACTIVE ,
277277 FMT_COOLDOWN_ACTIVE ,
278278 remaining
@@ -310,7 +310,7 @@ public boolean execute(Profile player, Command bukkitCmd, String commandInput, S
310310 e
311311 );
312312
313- String msg = language .get (KEY_UNAVAILABLE , MSG_UNAVAILABLE );
313+ String msg = language .getString (KEY_UNAVAILABLE , MSG_UNAVAILABLE );
314314 player .msg (NamedTextColor .RED , msg );
315315 return true ;
316316 }
@@ -372,14 +372,6 @@ private double getEffectiveCost(CommandRegistry cmd) {
372372 return cost ;
373373 }
374374
375- /**
376- * Checks if a player has sufficient funds for a command.
377- *
378- * @param player the profile to check
379- * @param cmd the command with associated cost
380- * @return {@code true} if the player can afford the command (or no cost is defined),
381- * {@code false} otherwise
382- */
383375 /**
384376 * Checks if a player has sufficient funds for a command.
385377 *
@@ -492,7 +484,7 @@ private void handleCommandException(Profile player, CommandRegistry cmd, Command
492484 switch (type ) {
493485 case SYNTAX_ERROR : {
494486 // "Error: <message>"
495- String errorPrefix = language .getFormatted (
487+ String errorPrefix = language .getString (
496488 KEY_COMMAND_ERROR ,
497489 FMT_COMMAND_ERROR ,
498490 e .getMessage ()
@@ -501,7 +493,7 @@ private void handleCommandException(Profile player, CommandRegistry cmd, Command
501493
502494 // Optional usage line
503495 if (cmd .getSyntax () != null && !cmd .getSyntax ().isEmpty ()) {
504- String usage = language .getFormatted (
496+ String usage = language .getString (
505497 KEY_SYNTAX_USAGE ,
506498 FMT_SYNTAX_USAGE ,
507499 cmd .getSyntax ()
@@ -512,26 +504,26 @@ private void handleCommandException(Profile player, CommandRegistry cmd, Command
512504 }
513505
514506 case PERMISSION_ERROR : {
515- String noPerm = language .get (KEY_NO_PERMISSION , MSG_NO_PERMISSION );
507+ String noPerm = language .getString (KEY_NO_PERMISSION , MSG_NO_PERMISSION );
516508 player .msg (NamedTextColor .RED , noPerm );
517509 break ;
518510 }
519511
520512 case SUBCOMMAND_PERMISSION : {
521- String noSubPerm = language .get (KEY_NO_SUB_PERMISSION , MSG_NO_SUB_PERMISSION );
513+ String noSubPerm = language .getString (KEY_NO_SUB_PERMISSION , MSG_NO_SUB_PERMISSION );
522514 player .msg (NamedTextColor .RED , noSubPerm );
523515 break ;
524516 }
525517
526518 case UNAVAILABLE_ERROR : {
527- String unavailable = language .get (KEY_UNAVAILABLE , MSG_UNAVAILABLE );
519+ String unavailable = language .getString (KEY_UNAVAILABLE , MSG_UNAVAILABLE );
528520 player .msg (NamedTextColor .RED , unavailable );
529521 break ;
530522 }
531523
532524 case GENERAL_ERROR :
533525 default : {
534- String msg = language .getFormatted (
526+ String msg = language .getString (
535527 KEY_COMMAND_ERROR ,
536528 FMT_COMMAND_ERROR ,
537529 e .getMessage ()
0 commit comments