Updates some KnarLib code
Some checks failed
EpicKnarvik97/Blacksmith/pipeline/head There was a failure building this commit

This commit is contained in:
2024-01-25 16:57:10 +01:00
parent c532160fb5
commit 455db78988
10 changed files with 56 additions and 53 deletions

View File

@@ -170,7 +170,8 @@ public abstract class EditCommand<K extends CustomTrait<L>, L extends Setting> i
getCurrentValueMessage(setting.getCommandName(), rawValue));
} else {
//Add a marker if the value has been customized
String marker = BlacksmithPlugin.translate(BlacksmithTranslatableMessage.SETTING_OVERRIDDEN_MARKER);
String marker = BlacksmithPlugin.getStringFormatter().getUnformattedMessage(
BlacksmithTranslatableMessage.SETTING_OVERRIDDEN_MARKER);
formatter.displayNeutralMessage(sender,
getCurrentValueMessage(setting.getCommandName(), rawValue) + marker);
}

View File

@@ -4,7 +4,6 @@ import net.knarcraft.blacksmith.BlacksmithPlugin;
import net.knarcraft.blacksmith.config.SmithPreset;
import net.knarcraft.blacksmith.config.SmithPresetFilter;
import net.knarcraft.blacksmith.formatting.BlacksmithTranslatableMessage;
import net.knarcraft.knarlib.formatting.StringFormatter;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -56,9 +55,9 @@ public class PresetCommand implements CommandExecutor {
for (Material material : includedMaterials) {
materialNames.add(material.name());
}
BlacksmithPlugin.getStringFormatter().displaySuccessMessage(sender, StringFormatter.replacePlaceholder(
BlacksmithPlugin.translate(BlacksmithTranslatableMessage.PRESET_MATERIALS),
"{materials}", String.join(", ", materialNames)));
BlacksmithPlugin.getStringFormatter().displaySuccessMessage(sender,
BlacksmithPlugin.getStringFormatter().replacePlaceholder(BlacksmithTranslatableMessage.PRESET_MATERIALS,
"{materials}", String.join(", ", materialNames)));
return true;
}