Skip to content

Commit

Permalink
Remove methods from message translations
Browse files Browse the repository at this point in the history
Fix wrong prefix fetching
  • Loading branch information
IanTapply22 committed Jun 23, 2024
1 parent ccf476a commit 602825a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public boolean onCommand(@NotNull CommandSender sender, org.bukkit.command.@NotN

// Check if the command is disabled
if (currentCommand.getRequiredAccess() == CommandAccess.DISABLED) {
sender.sendMessage(this.getMessageTranslations().getSerializedString(this.getMessageTranslations().getMessage("prefix"), Languages.getMessage("command-disabled")));
sender.sendMessage(this.getMessageTranslations().getSerializedString(Languages.getMessage("prefix"), Languages.getMessage("command-disabled")));
return false;
}

Expand Down
19 changes: 0 additions & 19 deletions src/main/java/net/jeqo/bloons/message/MessageTranslations.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,6 @@
*/
public record MessageTranslations(JavaPlugin instance) {

/**
* Get a message from the config.yml file
* @param id The ID of the message, type java.lang.String
* @param arg The argument to format the message with, type java.lang.String
* @return The formatted message, type java.lang.String
*/
public String getMessage(String id, String arg) {
return String.format(this.instance.getConfig().getString("messages." + id, ""), arg);
}

/**
* Get a message from the config.yml file
* @param id The ID of the message, type java.lang.String
* @return The message as a string, type java.lang.String
*/
public String getMessage(String id) {
return this.instance.getConfig().getString("messages." + id, "");
}

/**
* Converts a message containing MiniMessage serialized strings to a Component that can be used to
* send formatted messages with gradients, rainbows, etc.
Expand Down

0 comments on commit 602825a

Please sign in to comment.