From c50b3440419bf581f48bcad17658329b4dd7bd99 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Thu, 9 Apr 2020 21:28:48 +0100 Subject: [PATCH] Remove usage of deprecated server-side I18n --- src/main/java/electroblob/wizardry/Settings.java | 4 +--- src/main/java/electroblob/wizardry/spell/Spell.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/electroblob/wizardry/Settings.java b/src/main/java/electroblob/wizardry/Settings.java index c70459e2..4d2ebf30 100644 --- a/src/main/java/electroblob/wizardry/Settings.java +++ b/src/main/java/electroblob/wizardry/Settings.java @@ -11,7 +11,6 @@ import net.minecraft.entity.EntityList; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.translation.I18n; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; @@ -53,7 +52,6 @@ import java.util.regex.Pattern; */ // For the time being, I'm sticking with the old config system because @Config doesn't support custom config entry classes // @Config(modid = Wizardry.MODID) -@SuppressWarnings("deprecation") // Used server I18n deliberately; we want to write the comments in the actual config file in english. public final class Settings { // Category names @@ -447,7 +445,7 @@ public final class Settings { for(Spell spell : Spell.getAllSpells()){ property = config.get(SPELLS_CATEGORY, spell.getRegistryName().toString(), true, - I18n.translateToLocal("spell." + spell.getUnlocalisedName() + ".desc")); + "Set to false to disable this spell"); // Uses the same config key as the spell name, because - well, that's what it's called! property.setLanguageKey("spell." + spell.getUnlocalisedName()); Wizardry.proxy.setToNamedBooleanEntry(property); diff --git a/src/main/java/electroblob/wizardry/spell/Spell.java b/src/main/java/electroblob/wizardry/spell/Spell.java index b93b35ff..62d31b67 100644 --- a/src/main/java/electroblob/wizardry/spell/Spell.java +++ b/src/main/java/electroblob/wizardry/spell/Spell.java @@ -621,8 +621,8 @@ public abstract class Spell extends IForgeRegistryEntry.Impl implements C } /** - * Returns the unlocalised name of the spell, without any prefixes or suffixes, e.g. "flame_ray". This should - * only be used for translation purposes. + * Returns the unlocalised name of the spell, which is now its registry name as a string, e.g. "ebwizardry:flame_ray". + * This should only be used for translation purposes. */ public final String getUnlocalisedName(){ return unlocalisedName;