aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/pers/gwyog/gtneioreplugin/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/pers/gwyog/gtneioreplugin/util')
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java10
-rw-r--r--src/main/java/pers/gwyog/gtneioreplugin/util/GT6OreLayerHelper.java8
2 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java b/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java
index 9026aec71d..9991387703 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/util/GT5OreLayerHelper.java
@@ -21,6 +21,7 @@ public class GT5OreLayerHelper {
public static boolean gcBasicSupport = false;
public static boolean gcAsteroidSupport = false;
public static boolean immersiveEngineeringSupport = false;
+ public static int[] weightPerWorld = {0, 0, 0, 0, 0};
public static HashMap<String, OreLayerWrapper> mapOreLayerWrapper = new HashMap<String, OreLayerWrapper>();
public GT5OreLayerHelper() {
@@ -82,9 +83,9 @@ public class GT5OreLayerHelper {
public short betweenMeta;
public short sporadicMeta;
public String worldGenHeightRange;
- public String weightedChance;
public String weightedIEChance;
public String restrictBiome;
+ public int randomWeight;
public boolean genOverworld = false;
public boolean genNether = false;
public boolean genEnd = false;
@@ -101,15 +102,20 @@ public class GT5OreLayerHelper {
this.betweenMeta = worldGen.mBetweenMeta;
this.sporadicMeta = worldGen.mSporadicMeta;
this.worldGenHeightRange = worldGen.mMinY + "-" + worldGen.mMaxY;
- this.weightedChance = String.format("%.2f%%", (100.0f*worldGen.mWeight)/GT_Worldgen_GT_Ore_Layer.sWeight);
+ this.randomWeight = worldGen.mWeight;
this.genOverworld = worldGen.mOverworld;
this.genNether = worldGen.mNether;
this.genEnd = worldGen.mEnd;
+ weightPerWorld[0] += this.genOverworld ? this.randomWeight : 0;
+ weightPerWorld[1] += this.genNether ? this.randomWeight : 0;
+ weightPerWorld[2] += this.genEnd ? this.randomWeight : 0;
if (restrictBiomeSupport)
this.restrictBiome = worldGen.mRestrictBiome;
if (GT5OreLayerHelper.gcBasicSupport) {
this.genMoon = worldGen.mMoon;
this.genMars = worldGen.mMars;
+ weightPerWorld[3] += this.genMoon ? this.randomWeight : 0;
+ weightPerWorld[4] += this.genMars ? this.randomWeight : 0;
}
if (GT5OreLayerHelper.endAsteroidSupport)
this.genEndAsteroid = worldGen.mEndAsteroid;
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/util/GT6OreLayerHelper.java b/src/main/java/pers/gwyog/gtneioreplugin/util/GT6OreLayerHelper.java
index 70bddee30d..bc0b40f5a1 100644
--- a/src/main/java/pers/gwyog/gtneioreplugin/util/GT6OreLayerHelper.java
+++ b/src/main/java/pers/gwyog/gtneioreplugin/util/GT6OreLayerHelper.java
@@ -14,6 +14,7 @@ import net.minecraft.item.ItemStack;
import pers.gwyog.gtneioreplugin.GTNEIOrePlugin;
public class GT6OreLayerHelper {
+ public static int[] weightPerWorld = {0, 0, 0};
public static HashMap<String, OreLayerWrapper> mapOreLayerWrapper = new HashMap<String, OreLayerWrapper>();
public static Set<PrefixBlock> setOreNormalBasicTypes = new HashSet<PrefixBlock>();
@@ -33,7 +34,7 @@ public class GT6OreLayerHelper {
public short betweenMeta;
public short sporadicMeta;
public String worldGenHeightRange;
- public String weightedChance;
+ public int randomWeight;
public boolean genOverworld = false;
public boolean genNether = false;
public boolean genEnd = false;
@@ -45,10 +46,13 @@ public class GT6OreLayerHelper {
this.betweenMeta = worldGen.mBetweenMeta;
this.sporadicMeta = worldGen.mSporadicMeta;
this.worldGenHeightRange = worldGen.mMinY + "-" + worldGen.mMaxY;
- this.weightedChance = String.format("%.2f%%", (100.0f*worldGen.mWeight)/Worldgen_GT_Ore_Layer.sWeight);
+ this.randomWeight = worldGen.mWeight;
this.genOverworld = worldGen.mOverworld;
this.genNether = worldGen.mNether;
this.genEnd = worldGen.mEnd;
+ weightPerWorld[0] += this.genOverworld ? this.randomWeight : 0;
+ weightPerWorld[1] += this.genNether ? this.randomWeight : 0;
+ weightPerWorld[2] += this.genEnd ? this.randomWeight : 0;
}
}