aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pers/gwyog/gtneioreplugin/util
diff options
context:
space:
mode:
authorLOKKO12 <33183715+LOKKO12@users.noreply.github.com>2018-01-26 17:10:21 +0100
committerLOKKO12 <33183715+LOKKO12@users.noreply.github.com>2018-01-26 17:10:21 +0100
commit139001bc39cbf1eee935770dfbb5a0ffa45da5d8 (patch)
treed0444f3da83ba7b7e485bb94fccb5c401964944e /src/main/java/pers/gwyog/gtneioreplugin/util
parent9066c13deea8a77c3e4828b4fcddf7cf0a096a74 (diff)
downloadGT5-Unofficial-139001bc39cbf1eee935770dfbb5a0ffa45da5d8.tar.gz
GT5-Unofficial-139001bc39cbf1eee935770dfbb5a0ffa45da5d8.tar.bz2
GT5-Unofficial-139001bc39cbf1eee935770dfbb5a0ffa45da5d8.zip
Fixed it. upgrade to V1.0.5
Diffstat (limited to 'src/main/java/pers/gwyog/gtneioreplugin/util')
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/util/DimensionHelper.java70
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/util/GT5CFGHelper.java82
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreSmallHelper.java13
3 files changed, 91 insertions, 74 deletions
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/util/DimensionHelper.java b/src/main/java/pers/gwyog/gtneioreplugin/util/DimensionHelper.java
index d68dd65d69..f81e355f83 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/util/DimensionHelper.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/util/DimensionHelper.java
@@ -41,41 +41,45 @@ public class DimensionHelper {
"Nether",
"Overworld",
"TheEnd",
- "Vanilla_EndAsteroids"};
+ "Vanilla_EndAsteroids",
+ "Twilight",
+ "Underdark"};
public static String[] DimNameDisplayed =
{
- "End Asteroids",
- "Moon",
- "Asteroids",
- "Mars",
- "BarnardC",
- "BarnardE",
- "BarnardF",
- "Callisto",
- "CentauriA",
- "Ceres",
- "Deimos",
- "Enceladus",
- "Europa",
- "Ganymede",
- "Haumea",
+ "EA",
+ "MO",
+ "AS",
+ "MA",
+ "BC",
+ "BE",
+ "BF",
+ "Ca",
+ "CeA",
+ "Ce",
+ "De",
+ "En",
+ "Eu",
+ "Ga",
+ "Ha",
"Io",
- "Kuiperbelt",
- "MakeMake",
- "Mercury",
- "Miranda",
- "Oberon",
- "Phobos",
- "Pluto",
- "Proteus",
- "TcetiE",
- "Titan",
- "Triton",
- "VegaB",
- "Venus",
- "The Nether",
- "Overworld",
- "The End",
- "Far End Asteroids"};
+ "KB",
+ "MM",
+ "Me",
+ "Mi",
+ "Ob",
+ "Ph",
+ "Pu",
+ "Pr",
+ "TE",
+ "Ti",
+ "Tr",
+ "VB",
+ "Ve",
+ "Ne",
+ "OW",
+ "EN",
+ "VA",
+ "TF",
+ "DD"};
} \ No newline at end of file
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/util/GT5CFGHelper.java b/src/main/java/pers/gwyog/gtneioreplugin/util/GT5CFGHelper.java
index b5fd6ad6e5..33f5604fa7 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/util/GT5CFGHelper.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/util/GT5CFGHelper.java
@@ -2,7 +2,6 @@ package pers.gwyog.gtneioreplugin.util;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
@@ -17,7 +16,7 @@ public class GT5CFGHelper {
public static String GT5CFG(File F, String Veinname) {
//FMLLog.info(Veinname);
if (F == null) {
- FMLLog.bigWarning("GT_CFG_NOT_FOUND");
+ FMLLog.bigWarning("GT_CFG_NOT_found[0]");
return "Error while Loading CFG";
}
else
@@ -26,41 +25,70 @@ public class GT5CFGHelper {
if (buffer > F.length())
buffer = (int) F.length();
//allocate 10% of free memory for read-in-buffer, if there is less than filesize memory aviable
- //FMLLog.info("GT_CFG_FOUND");
+ //FMLLog.info("GT_CFG_found[0]");
FileReader in = new FileReader(F);
//FMLLog.info("FileReader created");
BufferedReader reader = new BufferedReader(in, buffer);
//FMLLog.info("BufferedReader" +Integer.toString(buffer)+"created");
- String st="";
+ String st=null;
List<String> raw= new ArrayList<String>();
List<String> rawbools = new ArrayList<String>();
- boolean found = false;
+ Boolean[] found = new Boolean[2];
+ found[0] = false;
+ found[1] = false;
do{
+ //FMLLog.info("erste");
//read until reached eof or mix {
st = reader.readLine();
//FMLLog.info("st: "+st);
- if ((reader.readLine() != null))
- if (st.contains("mix {")) {
- do{
- //read until reached eof or Veinname {
+ if (st != null && st.trim().equals("mix {")) {
+ while(!((st == null)||((st != null)&&found[0]))){
+ //FMLLog.info("zweite");
st = reader.readLine();
+ //read until reached eof or Veinname {
//FMLLog.info("MIXst: "+st);
- if ((reader.readLine() != null))
- if (st.contains(Veinname)) {
- //FMLLog.info("VEINNAMEst: "+st);
- //for (int i=0; i < 44;i++)
- do{
- //add everything below Veinname { undtil } to raw
- raw.add(reader.readLine());
- }while (!reader.readLine().contains("}")&&(reader.readLine() != null));
- found = true;
+ if (st != null && st.trim().equals(Veinname+" {")) {
+ //FMLLog.info("VEINNAMEst: "+st);
+ while (!((st == null)||((st != null)&&found[0]))){
+ st = reader.readLine();
+ if (st.trim().equals("}"))
+ found[0] = true;
+ //FMLLog.info("dritte");
+ //add everything below Veinname { undtil } to raw
+ raw.add(st);
+ }
+ }
}
- }while((!found) || (reader.readLine() != null));
}
- }while((!found) || (reader.readLine() != null));
-
- reader.close();//not needed anymore
+
+ if (st != null && st.trim().equals("dimensions {")) {
+ while(!((st == null)||((st != null)&&found[1]))){
+ //FMLLog.info("zweite");
+ st = reader.readLine();
+ if (st != null && (st.trim().equals("mix {"))) {
+ while(!((st == null)||((st != null)&&found[1]))){
+ //FMLLog.info("dritte");
+ st = reader.readLine();
+ //read until reached eof or Veinname {
+ //FMLLog.info("MIXst: "+st);
+ if (st != null && st.trim().equals(Veinname+" {")) {
+ //FMLLog.info("VEINNAMEst: "+st);
+ while (!((st == null)||((st != null)&&found[1]))){
+ st = reader.readLine();
+ if (st.trim().equals("}"))
+ found[1] = true;
+ //FMLLog.info("vierte");
+ //add everything below Veinname { undtil } to raw
+ raw.add(st);
+ }
+ }
+ }
+ }
+ }
+ }
+ }while(st != null);
+ reader.close();//not needed anymore
if (!raw.isEmpty())
for (int i=0; i < raw.size();i++) {
@@ -75,16 +103,14 @@ public class GT5CFGHelper {
String ret=" ";
- //HashSet<String> rawboolsset = new HashSet<String>();
+ HashSet<String> rawboolsset = new HashSet<String>();
if (!rawbools.isEmpty()) {
//remove dublicats
- /*
for (int i=0; i < rawbools.size();i++){
- st = rawbools.get(i).replace("B:", "").replace("_true", "").replace("_false", "").replaceAll(" ", "");
+ st = rawbools.get(i).replace("B:", "").replace("_true", "").replace("_false", "").replaceAll(" ", "").replaceAll("\"", "");
rawboolsset.add(st);
}
rawbools = new ArrayList<String>(rawboolsset);
- */
//filter for dims set to true
for (int i=0; i < rawbools.size();i++) {
st = rawbools.get(i);
@@ -92,14 +118,14 @@ public class GT5CFGHelper {
for (int j=0; j < DimensionHelper.DimName.length;j++) {
if(st.contains(DimensionHelper.DimName[j]))
if(st.contains("=true"))
- ret=(ret+DimensionHelper.DimNameDisplayed[j]+" ");
+ ret=(ret+DimensionHelper.DimNameDisplayed[j]+",");
}
}
}
ret = ret.trim();
//FMLLog.info("ret:"+ret);
if(ret.equals("")||ret.equals(" "))
- ret ="Not aviable in any Galactic Dim, maybe Deep Dark or Bedrock Dim";
+ ret ="Not aviable in any Galactic Dim!";
return ret;
} catch (IOException e) {
e.printStackTrace();
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreSmallHelper.java b/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreSmallHelper.java
index 4326475606..39173c756f 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreSmallHelper.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreSmallHelper.java
@@ -86,25 +86,12 @@ public class GT5OreSmallHelper {
public String worldGenHeightRange;
public short amountPerChunk;
public String restrictBiome;
- public boolean genOverworld = false;
- public boolean genNether = false;
- public boolean genEnd = false;
- public boolean genMoon = false;
- public boolean genMars = false;
public OreSmallWrapper(GT_Worldgen_GT_Ore_SmallPieces worldGen) {
this.oreGenName = worldGen.mWorldGenName;
this.oreMeta = worldGen.mMeta;
this.worldGenHeightRange = worldGen.mMinY + "-" + worldGen.mMaxY;
this.amountPerChunk = worldGen.mAmount;
- this.genOverworld = worldGen.mOverworld;
- this.genNether = worldGen.mNether;
- this.genEnd = worldGen.mEnd;
- //if (GT5OreSmallHelper.restrictBiomeSupport)
- // this.restrictBiome = worldGen.mRestrictBiome;
- // if (GT5OreSmallHelper.gcBasicSupport) {
- // this.genMoon = worldGen.mMoon;
- // this.genMars = worldGen.mMars;
}
}
}