From 83f6f8f542265968e47709353495bfef91c04d94 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Mon, 30 Apr 2018 18:40:07 +0200 Subject: hotfix for NoClassDefFoundError --- .../pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java | 6 +- .../gtneioreplugin/util/GT5OreLayerHelper.java | 92 +++++++++++----------- 2 files changed, 50 insertions(+), 48 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java b/src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java index 032da37281..e04444ad7c 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java @@ -19,7 +19,7 @@ public class GTNEIOrePlugin { public static final String MODID = "gtneioreplugin"; public static final String NAME = "GT NEI Ore Plugin GT:NH Mod"; public static final String VERSION = "@version@"; - public static boolean csv; + public static boolean csv = false; public static String CSVname; public static List OreVeins=new ArrayList(); public static HashSet OreV=new HashSet(); @@ -38,8 +38,10 @@ public class GTNEIOrePlugin { @EventHandler public void onLoadComplete(FMLLoadCompleteEvent event) { if (event.getSide() == Side.CLIENT) { - new GT5OreLayerHelper(); + GT5OreLayerHelper h = new GT5OreLayerHelper(); new GT5OreSmallHelper(); + if (csv) + h.make_csv(); } } diff --git a/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java b/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java index 0fb7540244..b3041f13c0 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java @@ -44,8 +44,53 @@ public class GT5OreLayerHelper { DimIDs[i]=0; for (GT_Worldgen_GT_Ore_Layer tWorldGen: GT_Worldgen_GT_Ore_Layer.sList) mapOreLayerWrapper.put(tWorldGen.mWorldGenName, new OreLayerWrapper(tWorldGen)); + } + + public class OreLayerWrapper { + public String veinName,worldGenHeightRange, weightedIEChance; + public short[] Meta = new short[4]; + public short randomWeight, size, density; + public List Weight = new ArrayList(); - if (GTNEIOrePlugin.csv) { + public OreLayerWrapper(GT_Worldgen_GT_Ore_Layer worldGen) { + this.veinName = worldGen.mWorldGenName; + this.Meta[0] = worldGen.mPrimaryMeta; + this.Meta[1] = worldGen.mSecondaryMeta; + this.Meta[2] = worldGen.mBetweenMeta; + this.Meta[3] = worldGen.mSporadicMeta; + this.size = worldGen.mSize; + this.density = worldGen.mDensity; + this.worldGenHeightRange = worldGen.mMinY + "-" + worldGen.mMaxY; + this.randomWeight = worldGen.mWeight; + } + } + + public static List Combsort(List liste) { + List liste2 = new ArrayList(liste.size()); + for (Oremix element : liste) { + liste2.add(element); + } + + int schritt = liste2.size(); + boolean vertauscht = false; + do { + vertauscht = false; + if (schritt > 1) { + schritt = (int) (schritt / 1.3); + } + for (int i = 0; i < liste2.size() - schritt; i++) { + if (liste2.get(i).getOreName().substring(0, 3).compareTo((liste2.get(i + schritt).getOreName().substring(0, 3))) > 0) { + T tmp = (T) liste2.get(i); + liste2.set(i, liste2.get(i + schritt)); + liste2.set(i + schritt, (Oremix) tmp); + vertauscht = true; + } + } + } while (vertauscht || schritt > 1); + return liste2; + } + + public static void make_csv() { Iterator it = mapOreLayerWrapper.entrySet().iterator(); while (it.hasNext()) { Oremix oremix = new Oremix(); @@ -133,51 +178,6 @@ public class GT5OreLayerHelper { // TODO Auto-generated catch block e.printStackTrace(); } - } - } - - public class OreLayerWrapper { - public String veinName,worldGenHeightRange, weightedIEChance; - public short[] Meta = new short[4]; - public short randomWeight, size, density; - public List Weight = new ArrayList(); - - public OreLayerWrapper(GT_Worldgen_GT_Ore_Layer worldGen) { - this.veinName = worldGen.mWorldGenName; - this.Meta[0] = worldGen.mPrimaryMeta; - this.Meta[1] = worldGen.mSecondaryMeta; - this.Meta[2] = worldGen.mBetweenMeta; - this.Meta[3] = worldGen.mSporadicMeta; - this.size = worldGen.mSize; - this.density = worldGen.mDensity; - this.worldGenHeightRange = worldGen.mMinY + "-" + worldGen.mMaxY; - this.randomWeight = worldGen.mWeight; - } - } - - public static List Combsort(List liste) { - List liste2 = new ArrayList(liste.size()); - for (Oremix element : liste) { - liste2.add(element); } - - int schritt = liste2.size(); - boolean vertauscht = false; - do { - vertauscht = false; - if (schritt > 1) { - schritt = (int) (schritt / 1.3); - } - for (int i = 0; i < liste2.size() - schritt; i++) { - if (liste2.get(i).getOreName().substring(0, 3).compareTo((liste2.get(i + schritt).getOreName().substring(0, 3))) > 0) { - T tmp = (T) liste2.get(i); - liste2.set(i, liste2.get(i + schritt)); - liste2.set(i + schritt, (Oremix) tmp); - vertauscht = true; - } - } - } while (vertauscht || schritt > 1); - return liste2; - } } \ No newline at end of file -- cgit