diff options
author | LOKKO12 <33183715+LOKKO12@users.noreply.github.com> | 2018-01-22 18:56:12 +0100 |
---|---|---|
committer | LOKKO12 <33183715+LOKKO12@users.noreply.github.com> | 2018-01-22 18:56:12 +0100 |
commit | 9066c13deea8a77c3e4828b4fcddf7cf0a096a74 (patch) | |
tree | a0f4ac442e59b1056b260d03e0c17b771470fae7 /src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5 | |
parent | 2bfa55842458c092acb599fd4876a74386680b0f (diff) | |
download | GT5-Unofficial-9066c13deea8a77c3e4828b4fcddf7cf0a096a74.tar.gz GT5-Unofficial-9066c13deea8a77c3e4828b4fcddf7cf0a096a74.tar.bz2 GT5-Unofficial-9066c13deea8a77c3e4828b4fcddf7cf0a096a74.zip |
- removed GT6 support
- removed IE support
- removed biome specific vein support
- removed ShowAll button due to Memory Issures
- fixed %material
- try to read out config without modifying it
- added Coustom Vein renamer
Diffstat (limited to 'src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5')
5 files changed, 84 insertions, 196 deletions
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5AsteroidStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5AsteroidStat.java index 48e51a5367..b6c676dc70 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5AsteroidStat.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5AsteroidStat.java @@ -1,4 +1,4 @@ -package pers.gwyog.gtneioreplugin.plugin.gregtech5; +/*package pers.gwyog.gtneioreplugin.plugin.gregtech5; import java.awt.Rectangle; import java.util.ArrayList; @@ -57,10 +57,10 @@ public class PluginGT5AsteroidStat extends PluginGT5Base { CachedAsteroidStatRecipe crecipe = (CachedAsteroidStatRecipe) this.arecipes.get(recipe); OreLayerWrapper oreLayer = GT5OreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName); GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedAsteroidName(oreLayer.veinName), 2, 18, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidPrimary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.primaryMeta)), 2, 31, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSecondary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.secondaryMeta)), 2, 44, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidBetween") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.betweenMeta)), 2, 57, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSporadic") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.sporadicMeta)), 2, 70, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidPrimary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.Meta[0])), 2, 31, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSecondary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.Meta[1])), 2, 44, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidBetween") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.Meta[2])), 2, 57, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSporadic") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.Meta[3])), 2, 70, 0x404040, false); GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": " + getWorldNameTranslated(oreLayer.genEndAsteroid, oreLayer.genGCAsteroid), 2, 83, 0x404040, false); GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); } @@ -94,10 +94,10 @@ public class PluginGT5AsteroidStat extends PluginGT5Base { for (String veinName: GT5OreLayerHelper.mapOreLayerWrapper.keySet()) { oreLayerWrapper = GT5OreLayerHelper.mapOreLayerWrapper.get(veinName); if (oreLayerWrapper.genEndAsteroid || oreLayerWrapper.genGCAsteroid) { - ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.primaryMeta+2000); - ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.secondaryMeta+2000); - ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.betweenMeta+2000); - ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.sporadicMeta+2000); + ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.Meta[0]+2000); + ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.Meta[1]+2000); + ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.Meta[2]+2000); + ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.Meta[3]+2000); this.arecipes.add(new CachedAsteroidStatRecipe(veinName, stackPrimary, stackSecondary, stackBetween, stackSporadic)); } } @@ -115,12 +115,12 @@ public class PluginGT5AsteroidStat extends PluginGT5Base { } short baseMeta = (short)(stack.getItemDamage() % 1000); for (OreLayerWrapper worldGen: GT5OreLayerHelper.mapOreLayerWrapper.values()) { - if (worldGen.primaryMeta == baseMeta || worldGen.secondaryMeta == baseMeta || worldGen.betweenMeta == baseMeta || worldGen.sporadicMeta == baseMeta) { + if (worldGen.Meta[0] == baseMeta || worldGen.Meta[1] == baseMeta || worldGen.Meta[2] == baseMeta || worldGen.Meta[3] == baseMeta) { if (worldGen.genEndAsteroid || worldGen.genGCAsteroid) { - ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.primaryMeta+2000); - ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.secondaryMeta+2000); - ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.betweenMeta+2000); - ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.sporadicMeta+2000); + ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.Meta[0]+2000); + ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.Meta[1]+2000); + ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.Meta[2]+2000); + ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.Meta[3]+2000); this.arecipes.add(new CachedAsteroidStatRecipe(worldGen.veinName, stackPrimary, stackSecondary, stackBetween, stackSporadic)); } } @@ -140,3 +140,4 @@ public class PluginGT5AsteroidStat extends PluginGT5Base { return I18n.format("gtnop.gui.asteroidStat.name"); } } +*/
\ No newline at end of file diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java index a61a8bb977..1a251ef514 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java @@ -5,6 +5,7 @@ import java.awt.Rectangle; import codechicken.lib.gui.GuiDraw; import codechicken.nei.recipe.TemplateRecipeHandler; import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect; +import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; import net.minecraft.client.resources.I18n; import net.minecraft.util.EnumChatFormatting; @@ -23,7 +24,7 @@ public class PluginGT5Base extends PluginBase { } public String getGTOreLocalizedName(short index) { - return GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(index)); + return Materials.getLocalizedNameForItem(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(index)), index%1000); } public String getGTOreUnlocalizedName(short index) { diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5IEVeinStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5IEVeinStat.java deleted file mode 100644 index 1d73ae5519..0000000000 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5IEVeinStat.java +++ /dev/null @@ -1,133 +0,0 @@ -package pers.gwyog.gtneioreplugin.plugin.gregtech5; - -import java.util.ArrayList; -import java.util.List; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_LanguageManager; -import net.minecraft.client.resources.I18n; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper; -import pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper.OreLayerWrapper; - -public class PluginGT5IEVeinStat extends PluginGT5Base { - - public class CachedIEVeinStatRecipe extends CachedRecipe { - public String veinName; - public PositionedStack positionedStackPrimary; - public PositionedStack positionedStackSecondary; - public PositionedStack positionedStackBetween; - public PositionedStack positionedStackSporadic; - - public CachedIEVeinStatRecipe(String veinName, ItemStack stackListPrimary, ItemStack stackListSecondary, - ItemStack stackListBetween, ItemStack stackListSporadic) { - this.veinName = veinName; - positionedStackPrimary = new PositionedStack(stackListPrimary, 2, 0); - positionedStackSecondary = new PositionedStack(stackListSecondary, 22, 0); - positionedStackBetween = new PositionedStack(stackListBetween, 42, 0); - positionedStackSporadic = new PositionedStack(stackListSporadic, 62, 0); - } - - @Override - public List<PositionedStack> getIngredients() { - List<PositionedStack> ingredientsList = new ArrayList<PositionedStack>(); - ingredientsList.add(positionedStackPrimary); - ingredientsList.add(positionedStackSecondary); - ingredientsList.add(positionedStackBetween); - ingredientsList.add(positionedStackSporadic); - return ingredientsList; - } - - @Override - public PositionedStack getResult() { - return null; - } - - } - - @Override - public void drawExtras(int recipe) { - CachedIEVeinStatRecipe crecipe = (CachedIEVeinStatRecipe) this.arecipes.get(recipe); - OreLayerWrapper oreLayer = GT5OreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName); - int stringLength1 = GuiDraw.getStringWidth(I18n.format("gtnop.gui.nei.weightedChance") + ": "); - int stringLength2 = GuiDraw.getStringWidth("40%"); - int beginXCoord = (stringLength1+stringLength2)/2; - GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer.veinName), 2, 18, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.ieVeinComponent") + ": ", 2, 31, 0x404040, false); - GuiDraw.drawStringR("40.00%", beginXCoord+5, 44, 0x404040, false); - GuiDraw.drawString(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.primaryMeta)), 2+stringLength1, 44, 0x404040, false); - GuiDraw.drawStringR("40.00%", beginXCoord+5, 57, 0x404040, false); - GuiDraw.drawString(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.secondaryMeta)), 2+stringLength1, 57, 0x404040, false); - GuiDraw.drawStringR("15.00%", beginXCoord+5, 70, 0x404040, false); - GuiDraw.drawString(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.betweenMeta)), 2+stringLength1, 70, 0x404040, false); - GuiDraw.drawStringR("5.00%", beginXCoord+5, 83, 0x404040, false); - GuiDraw.drawString(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.sporadicMeta)), 2+stringLength1, 83, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.weightedChance") + ": " + oreLayer.weightedIEChance, 2, 96, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.fromMod") + ": " + "Immersive Engineering", 2, 109, 0x404040, false); - GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); - } - - public String getLocalizedVeinName(String unlocalizedName) { - if (unlocalizedName.startsWith("ore.mix.custom.")) - return I18n.format("gtnop.ore.custom.name") + I18n.format("gtnop.ore.vein.name") + unlocalizedName.substring(15); - else - return I18n.format("gtnop." + unlocalizedName) + I18n.format("gtnop.ore.vein.name"); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results) { - if (outputId.equals(getOutputId())) { - OreLayerWrapper oreLayerWrapper; - for (String veinName: GT5OreLayerHelper.mapOreLayerWrapper.keySet()) { - oreLayerWrapper = GT5OreLayerHelper.mapOreLayerWrapper.get(veinName); - if (oreLayerWrapper.genIEVein) { - ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.primaryMeta); - ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.secondaryMeta); - ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.betweenMeta); - ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.sporadicMeta); - this.arecipes.add(new CachedIEVeinStatRecipe(veinName, stackPrimary, stackSecondary, stackBetween, stackSporadic)); - } - } - } - else - super.loadCraftingRecipes(outputId, results); - } - - @Override - public void loadCraftingRecipes(ItemStack stack) { - if (stack.getUnlocalizedName().startsWith("gt.blockores")) { - if (stack.getItemDamage()>16000) { - super.loadCraftingRecipes(stack); - return; - } - short baseMeta = (short)(stack.getItemDamage() % 1000); - for (OreLayerWrapper worldGen: GT5OreLayerHelper.mapOreLayerWrapper.values()) { - if (worldGen.primaryMeta == baseMeta || worldGen.secondaryMeta == baseMeta || worldGen.betweenMeta == baseMeta || worldGen.sporadicMeta == baseMeta) { - if (worldGen.genIEVein) { - ItemStack stackPrimary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.primaryMeta); - ItemStack stackSecondary = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.secondaryMeta); - ItemStack stackBetween = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.betweenMeta); - ItemStack stackSporadic = new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.sporadicMeta); - this.arecipes.add(new CachedIEVeinStatRecipe(worldGen.veinName, stackPrimary, stackSecondary, stackBetween, stackSporadic)); - } - } - } - } - else - super.loadCraftingRecipes(stack); - } - - @Override - public String getOutputId() { - return "GTOrePluginIEVeinCompat"; - } - - @Override - public String getRecipeName() { - return I18n.format("gtnop.gui.ieVeinStat.name"); - } -} diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5SmallOreStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5SmallOreStat.java index f1ddce6629..66ede68225 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5SmallOreStat.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5SmallOreStat.java @@ -64,8 +64,8 @@ public class PluginGT5SmallOreStat extends PluginGT5Base { GuiDraw.drawString(I18n.format("gtnop.gui.nei.oreName") + ": " + getGTOreLocalizedName((short)(oreSmall.oreMeta+16000)), 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, oreSmall.genMoon, oreSmall.genMars), 2, 57, 0x404040, false); - if (GT5OreSmallHelper.restrictBiomeSupport) GuiDraw.drawString(I18n.format("gtnop.gui.nei.restrictBiome") + ": " + getBiomeTranslated(oreSmall.restrictBiome), 2, 70, 0x404040, false); + // GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": " + getWorldNameTranslated(oreSmall.genOverworld, oreSmall.genNether, oreSmall.genEnd, oreSmall.genMoon, oreSmall.genMars), 2, 57, 0x404040, false); + // if (GT5OreSmallHelper.restrictBiomeSupport) GuiDraw.drawString(I18n.format("gtnop.gui.nei.restrictBiome") + ": " + getBiomeTranslated(oreSmall.restrictBiome), 2, 70, 0x404040, false); GuiDraw.drawString(I18n.format("gtnop.gui.nei.chanceDrops") + ": ", 2, 83+getRestrictBiomeOffset(), 0x404040, false); GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); } diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java index fd9eb314ad..fd17e810b9 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java @@ -1,16 +1,19 @@ package pers.gwyog.gtneioreplugin.plugin.gregtech5; import java.awt.Rectangle; +import java.io.File; +import java.io.IOException; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; - -import org.apache.http.impl.conn.tsccm.ConnPoolByRoute; +import java.util.Set; import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect; import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; import gregtech.common.GT_Worldgen_GT_Ore_Layer; import net.minecraft.client.gui.Gui; @@ -18,6 +21,8 @@ import net.minecraft.client.resources.I18n; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import pers.gwyog.gtneioreplugin.util.DimensionHelper; +import pers.gwyog.gtneioreplugin.util.GT5CFGHelper; import pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper; import pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper.OreLayerWrapper; @@ -71,10 +76,10 @@ public class PluginGT5VeinStat extends PluginGT5Base { List<ItemStack> stackListBetween = new ArrayList<ItemStack>(); List<ItemStack> stackListSporadic = new ArrayList<ItemStack>(); for (int i=0;i<7;i++) { - stackListPrimary.add(new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.primaryMeta+i*1000)); - stackListSecondary.add(new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.secondaryMeta+i*1000)); - stackListBetween.add(new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.betweenMeta+i*1000)); - stackListSporadic.add(new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.sporadicMeta+i*1000)); + stackListPrimary.add(new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.Meta[0]+i*1000)); + stackListSecondary.add(new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.Meta[1]+i*1000)); + stackListBetween.add(new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.Meta[2]+i*1000)); + stackListSporadic.add(new ItemStack(GregTech_API.sBlockOres1, 1, oreLayerWrapper.Meta[3]+i*1000)); } this.arecipes.add(new CachedVeinStatRecipe(veinName, stackListPrimary, stackListSecondary, stackListBetween, stackListSporadic)); } @@ -92,16 +97,16 @@ public class PluginGT5VeinStat extends PluginGT5Base { } short baseMeta = (short)(stack.getItemDamage() % 1000); for (OreLayerWrapper worldGen: GT5OreLayerHelper.mapOreLayerWrapper.values()) { - if (worldGen.primaryMeta == baseMeta || worldGen.secondaryMeta == baseMeta || worldGen.betweenMeta == baseMeta || worldGen.sporadicMeta == baseMeta) { + if (worldGen.Meta[0] == baseMeta || worldGen.Meta[1] == baseMeta || worldGen.Meta[2] == baseMeta || worldGen.Meta[3] == baseMeta) { List<ItemStack> stackListPrimary = new ArrayList<ItemStack>(); List<ItemStack> stackListSecondary = new ArrayList<ItemStack>(); List<ItemStack> stackListBetween = new ArrayList<ItemStack>(); List<ItemStack> stackListSporadic = new ArrayList<ItemStack>(); for (int i=0;i<getMaximumMaterialIndex(baseMeta, false);i++) { - stackListPrimary.add(new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.primaryMeta+i*1000)); - stackListSecondary.add(new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.secondaryMeta+i*1000)); - stackListBetween.add(new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.betweenMeta+i*1000)); - stackListSporadic.add(new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.sporadicMeta+i*1000)); + stackListPrimary.add(new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.Meta[0]+i*1000)); + stackListSecondary.add(new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.Meta[1]+i*1000)); + stackListBetween.add(new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.Meta[2]+i*1000)); + stackListSporadic.add(new ItemStack(GregTech_API.sBlockOres1, 1, worldGen.Meta[3]+i*1000)); } this.arecipes.add(new CachedVeinStatRecipe(worldGen.veinName, stackListPrimary, stackListSecondary, stackListBetween, stackListSporadic)); } @@ -110,58 +115,72 @@ public class PluginGT5VeinStat extends PluginGT5Base { else super.loadCraftingRecipes(stack); } - + @Override public void drawExtras(int recipe) { CachedVeinStatRecipe crecipe = (CachedVeinStatRecipe) this.arecipes.get(recipe); OreLayerWrapper oreLayer = GT5OreLayerHelper.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") + ": " + getGTOreLocalizedName(oreLayer.primaryMeta), 2, 31, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.secondaryOre") + ": " + getGTOreLocalizedName(oreLayer.secondaryMeta), 2, 44, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.betweenOre") + ": " + getGTOreLocalizedName(oreLayer.betweenMeta), 2, 57, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.sporadicOre") + ": " + getGTOreLocalizedName(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.worldNames") + ": " + getWorldNameTranslated(oreLayer.genOverworld, oreLayer.genNether, oreLayer.genEnd, oreLayer.genMoon, oreLayer.genMars), 2, 96, 0x404040, false); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.weightedChance") + ": " + getWeightedChance(oreLayer.randomWeight, oreLayer.genOverworld, oreLayer.genNether, oreLayer.genEnd, oreLayer.genMoon, oreLayer.genMars), 2, 109, 0x404040, false); - if (GT5OreLayerHelper.restrictBiomeSupport) GuiDraw.drawString(I18n.format("gtnop.gui.nei.restrictBiome") + ": " + getBiomeTranslated(oreLayer.restrictBiome), 2, 122, 0x404040, false); - GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); + + if (getLocalizedVeinName(oreLayer).length()>20) { + GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer).substring(0, 20), 2, 20, 0x404040, false); + if (getLocalizedVeinName(oreLayer).length()>40) { + GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer).substring(20, 40), 2, 30, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer).substring(40, getLocalizedVeinName(oreLayer).length()), 2, 40, 0x404040, false); + } + else + GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer).substring(20, getLocalizedVeinName(oreLayer).length()), 2, 30, 0x404040, false); + } + else + GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer), 2, 20, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.primaryOre") + ": " + getGTOreLocalizedName(oreLayer.Meta[0]), 2, 50, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.secondaryOre") + ": " + getGTOreLocalizedName(oreLayer.Meta[1]), 2, 60, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.betweenOre") + ": " + getGTOreLocalizedName(oreLayer.Meta[2]), 2, 70, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.sporadicOre") + ": " + getGTOreLocalizedName(oreLayer.Meta[3]), 2, 80, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.genHeight") + ": " + oreLayer.worldGenHeightRange, 2, 90, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": ", 2, 100, 0x404040, false); + GuiDraw.drawString(I18n.format("") + getDims(oreLayer), 2, 110, 0x404040, false); + // GuiDraw.drawString(I18n.format("gtnop.gui.nei.weightedChance") + ": " + getWeightedChance(oreLayer), 2, 122, 0x404040, false); + //if (GT5OreLayerHelper.restrictBiomeSupport) GuiDraw.drawString(I18n.format("gtnop.gui.nei.restrictBiome") + ": " + getBiomeTranslated(oreLayer.restrictBiome), 2, 122, 0x404040, false); + //GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); } - public String getLocalizedVeinName(String unlocalizedName) { + public String getLocalizedVeinName(OreLayerWrapper oreLayer) { + + String unlocalizedName = oreLayer.veinName; if (unlocalizedName.startsWith("ore.mix.custom.")) - return I18n.format("gtnop.ore.custom.name") + I18n.format("gtnop.ore.vein.name") + unlocalizedName.substring(15); + return I18n.format(coustomVeinRenamer(oreLayer));//I18n.format("gtnop.ore.custom.name") + I18n.format("gtnop.ore.vein.name") + unlocalizedName.substring(15); else return I18n.format("gtnop." + unlocalizedName) + I18n.format("gtnop.ore.vein.name"); } - public String getWeightedChance(int randomWeight, boolean genOverworld, boolean genNether, boolean genEnd, boolean genMoon, boolean genMars) { + public String coustomVeinRenamer(OreLayerWrapper oreLayer) { + Set<String> s = new HashSet<String>(); + for (int i=0; i < 4; i++) + s.add(getGTOreLocalizedName(oreLayer.Meta[i]).replaceAll(" ", "")); + return s.toString() + .replace("[".charAt(0), ",".charAt(0)) + .replace("]".charAt(0), ",".charAt(0)) + .replaceAll(" Ore", ",") + .replaceAll("Ore", ",") + .replaceAll(",","") + .trim() + .concat(" Vein"); + } + + /*public String getWeightedChance(OreLayerWrapper oreLayer) { String weightedChance = ""; - if (genOverworld && GT5OreLayerHelper.weightPerWorld[0] != 0) { + for (int i=0; i < oreLayer.alloweddims.size(); i++) { + if (oreLayer.alloweddims.get(i) && (oreLayer.Weight.get(i) != 0)) { if (!weightedChance.isEmpty()) weightedChance += ", "; - weightedChance += String.format("%.2f%%", (100.0f*randomWeight)/GT5OreLayerHelper.weightPerWorld[0]); + weightedChance += String.format("%.2f%%", (100.0f*oreLayer.Weight.get(i))/GT5OreLayerHelper.weightPerWorld[i]); } - if (genNether && GT5OreLayerHelper.weightPerWorld[1] != 0) { - if (!weightedChance.isEmpty()) - weightedChance += ", "; - weightedChance += String.format("%.2f%%", (100.0f*randomWeight)/GT5OreLayerHelper.weightPerWorld[1]); - } - if (genEnd && GT5OreLayerHelper.weightPerWorld[2] != 0) { - if (!weightedChance.isEmpty()) - weightedChance += ", "; - weightedChance += String.format("%.2f%%", (100.0f*randomWeight)/GT5OreLayerHelper.weightPerWorld[2]); - } - if (genMoon && GT5OreLayerHelper.weightPerWorld[3] != 0) { - if (!weightedChance.isEmpty()) - weightedChance += ", "; - weightedChance += String.format("%.2f%%", (100.0f*randomWeight)/GT5OreLayerHelper.weightPerWorld[3]); - } - if (genMars && GT5OreLayerHelper.weightPerWorld[4] != 0) { - if (!weightedChance.isEmpty()) - weightedChance += ", "; - weightedChance += String.format("%.2f%%", (100.0f*randomWeight)/GT5OreLayerHelper.weightPerWorld[4]); } return weightedChance; + }*/ + + public String getDims(OreLayerWrapper oreLayer) { + return GT5CFGHelper.GT5CFG(GregTech_API.sWorldgenFile.mConfig.getConfigFile(), oreLayer.veinName.replace("ore.mix.custom.", "").replace("ore.mix.", "")); } @Override |