aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pers/gwyog/gtneioreplugin/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/pers/gwyog/gtneioreplugin/plugin')
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6Base.java35
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6BedrockOreStat.java11
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6SmallOreStat.java5
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6VeinStat.java11
4 files changed, 47 insertions, 15 deletions
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6Base.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6Base.java
new file mode 100644
index 0000000000..f047fbb1ab
--- /dev/null
+++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6Base.java
@@ -0,0 +1,35 @@
+package pers.gwyog.gtneioreplugin.plugin.gregtech6;
+
+import gregapi.data.CS;
+import gregapi.lang.LanguageHandler;
+import net.minecraft.client.resources.I18n;
+import pers.gwyog.gtneioreplugin.plugin.PluginBase;
+
+public class PluginGT6Base extends PluginBase {
+
+ public static String getLocalizedOreName(short meta) {
+ // meta==-1 means OreDictMaterial is MT.NULL
+ if (meta==-1)
+ return I18n.format("gtnop.ore.null.name");
+ else
+ return LanguageHandler.translate("oredict.ore" + CS.BlocksGT.ore.getMetaMaterial(meta).mNameInternal + ".name");
+ }
+
+ public static String getLocalizedSmallOreName(short meta) {
+ // meta==-1 means OreDictMaterial is MT.NULL
+ if (meta==-1)
+ return I18n.format("gtnop.ore.null.name");
+ else
+ return LanguageHandler.translate("oredict.oreSmall" + CS.BlocksGT.oreSmall.getMetaMaterial(meta).mNameInternal + ".name");
+ }
+
+ public static String getLocalizedOreBedrockName(short meta) {
+ // meta==-1 means OreDictMaterial is MT.NULL
+ if (meta==-1)
+ return I18n.format("gtnop.ore.null.name");
+ else
+ return LanguageHandler.translate("oredict.oreBedrock" + CS.BlocksGT.ore.getMetaMaterial(meta).mNameInternal + ".name");
+ }
+
+
+}
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6BedrockOreStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6BedrockOreStat.java
index ce46736597..daad693c56 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6BedrockOreStat.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6BedrockOreStat.java
@@ -11,13 +11,12 @@ import gregapi.data.CS;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import pers.gwyog.gtneioreplugin.plugin.PluginBase;
import pers.gwyog.gtneioreplugin.util.GT6OreBedrockHelper;
import pers.gwyog.gtneioreplugin.util.GT6OreLayerHelper;
import pers.gwyog.gtneioreplugin.util.GT6OreSmallHelper;
import pers.gwyog.gtneioreplugin.util.GT6OreBedrockHelper.OreBedrockWrapper;
-public class PluginGT6BedrockOreStat extends PluginBase {
+public class PluginGT6BedrockOreStat extends PluginGT6Base {
public class CachedBedrockOreStatRecipe extends CachedRecipe {
public String oreName;
@@ -90,10 +89,10 @@ public class PluginGT6BedrockOreStat extends PluginBase {
public void drawExtras(int recipe) {
CachedBedrockOreStatRecipe crecipe = (CachedBedrockOreStatRecipe) this.arecipes.get(recipe);
OreBedrockWrapper oreLayer = GT6OreBedrockHelper.mapOreBedrockWrapper.get(crecipe.oreName);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreName") + ": " + GT6OreBedrockHelper.mapMetaToLocalizedName.get(oreLayer.meta), 2, 18, 0x404040, false);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreOthers") + ": " + GT6OreSmallHelper.mapMetaToLocalizedName.get(oreLayer.meta), 2, 31, 0x404040, false);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreOthers") + ": " + GT6OreLayerHelper.mapMetaToLocalizedName.get(oreLayer.meta), 2, 44, 0x404040, false);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreOthers") + ": " + GT6OreSmallHelper.mapMetaToLocalizedName.get(oreLayer.meta), 2, 57, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreName") + ": " + getLocalizedOreBedrockName(oreLayer.meta), 2, 18, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreOthers") + ": " + getLocalizedSmallOreName(oreLayer.meta), 2, 31, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreOthers") + ": " + getLocalizedOreName(oreLayer.meta), 2, 44, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreOthers") + ": " + getLocalizedSmallOreName(oreLayer.meta), 2, 57, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.genHeight") + ": " + "0-6", 2, 70, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.nei.genPosition") + ": " + I18n.format("gtnop.nei.genPositionInfo"), 2,83, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.weightedChance") + ": " + "1/" + oreLayer.probability, 2, 96, 0x404040, false);
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6SmallOreStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6SmallOreStat.java
index 02f43a02f9..effcb5cc16 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6SmallOreStat.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6SmallOreStat.java
@@ -16,11 +16,10 @@ import gregapi.oredict.OreDictMaterial;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import pers.gwyog.gtneioreplugin.plugin.PluginBase;
import pers.gwyog.gtneioreplugin.util.GT6OreSmallHelper;
import pers.gwyog.gtneioreplugin.util.GT6OreSmallHelper.OreSmallWrapper;
-public class PluginGT6SmallOreStat extends PluginBase {
+public class PluginGT6SmallOreStat extends PluginGT6Base {
public class CachedOreSmallRecipe extends CachedRecipe {
public String oreGenName;
@@ -60,7 +59,7 @@ public class PluginGT6SmallOreStat extends PluginBase {
public void drawExtras(int recipe) {
CachedOreSmallRecipe crecipe = (CachedOreSmallRecipe) this.arecipes.get(recipe);
OreSmallWrapper oreSmall = GT6OreSmallHelper.mapOreSmallWrapper.get(crecipe.oreGenName);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreName") + ": " + GT6OreSmallHelper.mapMetaToLocalizedName.get(oreSmall.oreMeta), 2, 18, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreName") + ": " + getLocalizedSmallOreName(oreSmall.oreMeta), 2, 18, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.genHeight") + ": " + oreSmall.worldGenHeightRange, 2, 31, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.amount") + ": " + oreSmall.amountPerChunk, 2, 44, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": " + getWorldNameTranslated(oreSmall.genOverworld, oreSmall.genNether, oreSmall.genEnd, false, false), 2, 57, 0x404040, false);
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6VeinStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6VeinStat.java
index 83ebb1211e..82714dd374 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6VeinStat.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech6/PluginGT6VeinStat.java
@@ -12,11 +12,10 @@ import gregapi.data.CS;
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
-import pers.gwyog.gtneioreplugin.plugin.PluginBase;
import pers.gwyog.gtneioreplugin.util.GT6OreLayerHelper;
import pers.gwyog.gtneioreplugin.util.GT6OreLayerHelper.OreLayerWrapper;
-public class PluginGT6VeinStat extends PluginBase {
+public class PluginGT6VeinStat extends PluginGT6Base {
public class CachedVeinStatRecipe extends CachedRecipe {
public String veinName;
@@ -108,10 +107,10 @@ public class PluginGT6VeinStat extends PluginBase {
CachedVeinStatRecipe crecipe = (CachedVeinStatRecipe) this.arecipes.get(recipe);
OreLayerWrapper oreLayer = GT6OreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer.veinName), 2, 18, 0x404040, false);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.primaryOre") + ": " + GT6OreLayerHelper.mapMetaToLocalizedName.get(oreLayer.primaryMeta), 2, 31, 0x404040, false);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.secondaryOre") + ": " + GT6OreLayerHelper.mapMetaToLocalizedName.get(oreLayer.secondaryMeta), 2, 44, 0x404040, false);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.betweenOre") + ": " + GT6OreLayerHelper.mapMetaToLocalizedName.get(oreLayer.betweenMeta), 2, 57, 0x404040, false);
- GuiDraw.drawString(I18n.format("gtnop.gui.nei.sporadicOre") + ": " + GT6OreLayerHelper.mapMetaToLocalizedName.get(oreLayer.sporadicMeta), 2, 70, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.primaryOre") + ": " + getLocalizedOreName(oreLayer.primaryMeta), 2, 31, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.secondaryOre") + ": " + getLocalizedOreName(oreLayer.secondaryMeta), 2, 44, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.betweenOre") + ": " + getLocalizedOreName(oreLayer.betweenMeta), 2, 57, 0x404040, false);
+ GuiDraw.drawString(I18n.format("gtnop.gui.nei.sporadicOre") + ": " + getLocalizedOreName(oreLayer.sporadicMeta), 2, 70, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.genHeight") + ": " + oreLayer.worldGenHeightRange, 2, 83, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.weightedChance") + ": " + oreLayer.weightedChance, 2, 96, 0x404040, false);
GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": " + getWorldNameTranslated(oreLayer.genOverworld, oreLayer.genNether, oreLayer.genEnd, false, false), 2, 109, 0x404040, false);