aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2018-04-30 18:40:07 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2018-04-30 18:40:07 +0200
commit83f6f8f542265968e47709353495bfef91c04d94 (patch)
tree8f64851af1042fc9ae43e50ec1db620da7da4731
parent0be290d7cf3003ae41276524b49932c17d90e4f5 (diff)
downloadGT5-Unofficial-83f6f8f542265968e47709353495bfef91c04d94.tar.gz
GT5-Unofficial-83f6f8f542265968e47709353495bfef91c04d94.tar.bz2
GT5-Unofficial-83f6f8f542265968e47709353495bfef91c04d94.zip
hotfix for NoClassDefFoundError
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/GTNEIOrePlugin.java6
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java92
2 files changed, 50 insertions, 48 deletions
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<Oremix> 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<Integer> Weight = new ArrayList<Integer>();
- 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 <T> List<Oremix> Combsort(List<Oremix> liste) {
+ List<Oremix> liste2 = new ArrayList<Oremix>(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<Integer> Weight = new ArrayList<Integer>();
-
- 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 <T> List<Oremix> Combsort(List<Oremix> liste) {
- List<Oremix> liste2 = new ArrayList<Oremix>(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