aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtneioreplugin/plugin/gregtech5
diff options
context:
space:
mode:
authorLyft <127234178+Lyfts@users.noreply.github.com>2024-09-28 16:33:57 +0200
committerGitHub <noreply@github.com>2024-09-28 14:33:57 +0000
commite08a304cd38f54d023a9ac4534bcd20d10cdd7c9 (patch)
tree7b5b6eec14c969038d5f25cb3129f8b800d43c3a /src/main/java/gtneioreplugin/plugin/gregtech5
parentb8eac286d452e9b0ab1c16cd12524c47c25c6d94 (diff)
downloadGT5-Unofficial-e08a304cd38f54d023a9ac4534bcd20d10cdd7c9.tar.gz
GT5-Unofficial-e08a304cd38f54d023a9ac4534bcd20d10cdd7c9.tar.bz2
GT5-Unofficial-e08a304cd38f54d023a9ac4534bcd20d10cdd7c9.zip
Give ore mixes localized names (#3290)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gtneioreplugin/plugin/gregtech5')
-rw-r--r--src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java28
-rw-r--r--src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java2
2 files changed, 4 insertions, 26 deletions
diff --git a/src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java b/src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java
index 86117f099a..859ea87bb2 100644
--- a/src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java
+++ b/src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java
@@ -3,38 +3,16 @@ package gtneioreplugin.plugin.gregtech5;
import net.minecraft.client.resources.I18n;
import codechicken.lib.gui.GuiDraw;
-import gregtech.api.GregTechAPI;
import gregtech.api.enums.Materials;
import gregtech.api.util.GTLanguageManager;
import gtneioreplugin.plugin.PluginBase;
public abstract class PluginGT5Base extends PluginBase {
- protected static String getLocalizedNameForItem(Materials aMaterial, String aFormat) {
- return String.format(
- aFormat.replace("%s", "%temp")
- .replace("%material", "%s"),
- aMaterial.mLocalizedName)
- .replace("%temp", "%s");
- }
-
- protected static String getLocalizedNameForItem(String aFormat, int aMaterialID) {
- if (aMaterialID >= 0 && aMaterialID < 1000) {
- Materials aMaterial = GregTechAPI.sGeneratedMaterials[aMaterialID];
- if (aMaterial != null) {
- return getLocalizedNameForItem(aMaterial, aFormat);
- }
- }
- return aFormat;
- }
-
public static String getGTOreLocalizedName(short index) {
-
- if (!getLocalizedNameForItem(GTLanguageManager.getTranslation(getGTOreUnlocalizedName(index)), index % 1000)
- .contains("Awakened"))
- return getLocalizedNameForItem(
- GTLanguageManager.getTranslation(getGTOreUnlocalizedName(index)),
- index % 1000);
+ String name = Materials
+ .getLocalizedNameForItem(GTLanguageManager.getTranslation(getGTOreUnlocalizedName(index)), index % 1000);
+ if (!name.contains("Awakened")) return name;
else return "Aw. Draconium Ore";
}
diff --git a/src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java b/src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java
index 6e02539a87..cb89a0bc7b 100644
--- a/src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java
+++ b/src/main/java/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java
@@ -91,7 +91,7 @@ public class PluginGT5VeinStat extends PluginGT5Base {
}
private static void drawVeinName(OreLayerWrapper oreLayer) {
- drawVeinNameLine(I18n.format(oreLayer.veinName) + " ");
+ drawVeinNameLine(oreLayer.localizedName + " ");
}
private static void drawVeinNameLine(String veinName) {