Updates Spigot, and fixes depreciated code
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

This commit is contained in:
2024-05-04 02:46:46 +02:00
parent 44f8bb36b0
commit 7e5525bd00
13 changed files with 38 additions and 338 deletions

View File

@ -172,7 +172,7 @@ public enum BlacksmithTranslatableMessage implements TranslatableMessage {
* @return <p>The string to display to a user</p>
*/
public static String getItemValueChangedMessage(String setting, ItemType itemType, String item, String newValue) {
StringReplacer stringReplacer = new StringReplacer(BlacksmithPlugin.getStringFormatter().getUnformattedMessage(
StringReplacer stringReplacer = new StringReplacer(BlacksmithPlugin.getStringFormatter().getUnFormattedMessage(
BlacksmithTranslatableMessage.VALUE_FOR_ITEM_CHANGED));
stringReplacer.add("{setting}", setting);
stringReplacer.add("{itemType}", itemType.getItemTypeName());
@ -204,7 +204,7 @@ public enum BlacksmithTranslatableMessage implements TranslatableMessage {
* @return <p>The string to display to a user</p>
*/
public static String getItemCurrentValueMessage(String setting, ItemType itemType, String item, String currentValue) {
StringReplacer stringReplacer = new StringReplacer(BlacksmithPlugin.getStringFormatter().getUnformattedMessage(
StringReplacer stringReplacer = new StringReplacer(BlacksmithPlugin.getStringFormatter().getUnFormattedMessage(
BlacksmithTranslatableMessage.CURRENT_VALUE_FOR_ITEM));
stringReplacer.add("{setting}", setting);
stringReplacer.add("{itemType}", itemType.getItemTypeName());

View File

@ -19,9 +19,9 @@ public enum ItemType {
public String getItemTypeName() {
StringFormatter stringFormatter = BlacksmithPlugin.getStringFormatter();
return switch (this) {
case MATERIAL -> stringFormatter.getUnformattedMessage(BlacksmithTranslatableMessage.ITEM_TYPE_MATERIAL);
case MATERIAL -> stringFormatter.getUnFormattedMessage(BlacksmithTranslatableMessage.ITEM_TYPE_MATERIAL);
case ENCHANTMENT ->
stringFormatter.getUnformattedMessage(BlacksmithTranslatableMessage.ITEM_TYPE_ENCHANTMENT);
stringFormatter.getUnFormattedMessage(BlacksmithTranslatableMessage.ITEM_TYPE_ENCHANTMENT);
};
}

View File

@ -53,7 +53,7 @@ public final class TimeFormatter {
* @return <p>Text describing the time interval</p>
*/
private static String getMessageFromInterval(TimeInterval interval) {
String text = BlacksmithPlugin.getStringFormatter().getUnformattedMessage(
String text = BlacksmithPlugin.getStringFormatter().getUnFormattedMessage(
BlacksmithTranslatableMessage.valueOf(interval.name()));
//Choose a random entry if a comma-separated list is provided