aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pers/gwyog/gtneioreplugin/plugin
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2018-04-24 18:47:47 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2018-04-24 18:47:47 +0200
commitb0e5b659c0e9ded575f6a05bd6b61ae2a5b4b27f (patch)
tree0beb51ed16d5478b773d6e213119589606c6968d /src/main/java/pers/gwyog/gtneioreplugin/plugin
parent849edc278f7cfb71f4b7b6132cfdea3c1ed056e8 (diff)
downloadGT5-Unofficial-b0e5b659c0e9ded575f6a05bd6b61ae2a5b4b27f.tar.gz
GT5-Unofficial-b0e5b659c0e9ded575f6a05bd6b61ae2a5b4b27f.tar.bz2
GT5-Unofficial-b0e5b659c0e9ded575f6a05bd6b61ae2a5b4b27f.zip
added Sheetexport feature
+ added some config options
Diffstat (limited to 'src/main/java/pers/gwyog/gtneioreplugin/plugin')
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java1
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java11
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java57
3 files changed, 38 insertions, 31 deletions
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java
index 11b1b925f2..cbca2a66c6 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginBase.java
@@ -48,4 +48,5 @@ public class PluginBase extends TemplateRecipeHandler {
public int getGuiWidth() {
return 166;
}
+
}
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 242b27f23e..1d612d8c9c 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5Base.java
@@ -1,14 +1,7 @@
package pers.gwyog.gtneioreplugin.plugin.gregtech5;
-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;
import pers.gwyog.gtneioreplugin.plugin.PluginBase;
public class PluginGT5Base extends PluginBase {
@@ -23,7 +16,7 @@ public class PluginGT5Base extends PluginBase {
return 5;
}
- public String getGTOreLocalizedName(short index) {
+ public static String getGTOreLocalizedName(short index) {
if (!Materials.getLocalizedNameForItem(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(index)), index%1000).contains("Awakened"))
return Materials.getLocalizedNameForItem(GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(index)), index%1000);
@@ -31,7 +24,7 @@ public class PluginGT5Base extends PluginBase {
return "Aw. Draconium Ore";
}
- public String getGTOreUnlocalizedName(short index) {
+ public static String getGTOreUnlocalizedName(short index) {
return "gt.blockores." + index + ".name";
}
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 b6081fc9b0..ddb130eec3 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/gregtech5/PluginGT5VeinStat.java
@@ -1,31 +1,31 @@
package pers.gwyog.gtneioreplugin.plugin.gregtech5;
-import java.awt.Rectangle;
-import java.io.File;
+import java.io.FileWriter;
import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import com.opencsv.bean.ColumnPositionMappingStrategy;
+import com.opencsv.bean.StatefulBeanToCsv;
+import com.opencsv.bean.StatefulBeanToCsvBuilder;
+import com.opencsv.exceptions.CsvDataTypeMismatchException;
+import com.opencsv.exceptions.CsvRequiredFieldEmptyException;
+
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.PositionedStack;
-import codechicken.nei.recipe.TemplateRecipeHandler;
-import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
-import cpw.mods.fml.common.FMLLog;
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;
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.GTNEIOrePlugin;
import pers.gwyog.gtneioreplugin.util.GT5CFGHelper;
import pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper;
import pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper.OreLayerWrapper;
+import pers.gwyog.gtneioreplugin.util.Oremix;
public class PluginGT5VeinStat extends PluginGT5Base {
@@ -122,6 +122,8 @@ public class PluginGT5VeinStat extends PluginGT5Base {
CachedVeinStatRecipe crecipe = (CachedVeinStatRecipe) this.arecipes.get(recipe);
OreLayerWrapper oreLayer = GT5OreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName);
+ String Dims = getDims(oreLayer);
+
if (getLocalizedVeinName(oreLayer).length>1) {
GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer)[0], 2, 20, 0x404040, false);
if (getLocalizedVeinName(oreLayer).length>2) {
@@ -133,29 +135,40 @@ public class PluginGT5VeinStat extends PluginGT5Base {
}
else
GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer)[0], 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.weightedChance") + ": " + Integer.toString(oreLayer.randomWeight), 100, 90, 0x404040, false);
+
GuiDraw.drawString(I18n.format("gtnop.gui.nei.worldNames") + ": ", 2, 100, 0x404040, false);
- if (getDims(oreLayer).length()>36) {
- GuiDraw.drawString(I18n.format("") + getDims(oreLayer).substring(0, 36), 2, 110, 0x404040, false);
- if (getDims(oreLayer).length()>70) {
- GuiDraw.drawString(I18n.format("") + getDims(oreLayer).substring(36, 70), 2, 120, 0x404040, false);
- GuiDraw.drawString(I18n.format("") + getDims(oreLayer).substring(70, getDims(oreLayer).length()-1), 2, 130, 0x404040, false);
+ if (Dims.length()>36) {
+ GuiDraw.drawString(I18n.format("") + Dims.substring(0, 36), 2, 110, 0x404040, false);
+ if (Dims.length()>70) {
+ GuiDraw.drawString(I18n.format("") + Dims.substring(36, 70), 2, 120, 0x404040, false);
+ GuiDraw.drawString(I18n.format("") + Dims.substring(70, Dims.length()-1), 2, 130, 0x404040, false);
}
else
- GuiDraw.drawString(I18n.format("") + getDims(oreLayer).substring(36, getDims(oreLayer).length()-1), 2, 120, 0x404040, false);
+ GuiDraw.drawString(I18n.format("") + Dims.substring(36, Dims.length()-1), 2, 120, 0x404040, false);
}
else
- GuiDraw.drawString(I18n.format("") + getDims(oreLayer).substring(0, getDims(oreLayer).length()-1), 2, 110, 0x404040, false);
+ GuiDraw.drawString(I18n.format("") + Dims.substring(0, Dims.length()-1), 2, 110, 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(OreLayerWrapper oreLayer) {
+ public static String[] getLocalizedVeinName(OreLayerWrapper oreLayer) {
String unlocalizedName = oreLayer.veinName;
if (unlocalizedName.startsWith("ore.mix.custom."))
@@ -164,7 +177,7 @@ public class PluginGT5VeinStat extends PluginGT5Base {
return new String[] {I18n.format("gtnop." + unlocalizedName) + I18n.format("gtnop.ore.vein.name")};
}
- public String coustomVeinRenamer(OreLayerWrapper oreLayer) {
+ public static String coustomVeinRenamer(OreLayerWrapper oreLayer) {
Set<String> s = new HashSet<String>();
for (int i=0; i < 4; i++)
s.add(getGTOreLocalizedName(oreLayer.Meta[i]).replaceAll(" ", ""));
@@ -197,11 +210,11 @@ public class PluginGT5VeinStat extends PluginGT5Base {
return weightedChance;
}*/
- public String getDims(OreLayerWrapper oreLayer) {
+ public static String getDims(OreLayerWrapper oreLayer) {
return GT5CFGHelper.GT5CFG(GregTech_API.sWorldgenFile.mConfig.getConfigFile(), oreLayer.veinName.replace("ore.mix.custom.", "").replace("ore.mix.", ""));
}
- public String[] get_Cnames(OreLayerWrapper oreLayer) {
+ public static String[] get_Cnames(OreLayerWrapper oreLayer) {
String[] splt = coustomVeinRenamer(oreLayer).split("\\s");
/*HashSet<String> h = new HashSet<String>();