Browse Source

Fixinga Crash with Gregtania

Gregorius Techneticies 2 months ago
parent
commit
fb95856b0c
Signed by: Gregorius Techneticies <gregoriustech@gmail.com> GPG Key ID: 1B693EA14F2FD70F
1 changed files with 8 additions and 5 deletions
  1. 8
    5
      src/main/java/gregapi/worldgen/StoneLayerOres.java

+ 8
- 5
src/main/java/gregapi/worldgen/StoneLayerOres.java View File

@@ -21,6 +21,7 @@ package gregapi.worldgen;
21 21
 
22 22
 import static gregapi.data.CS.*;
23 23
 
24
+import java.util.ArrayList;
24 25
 import java.util.Collection;
25 26
 import java.util.Random;
26 27
 
@@ -36,7 +37,9 @@ public class StoneLayerOres {
36 37
 	public OreDictMaterial mMaterial;
37 38
 	/** The Material Amount will determine the chance in the form of an X of U Chance. */
38 39
 	public long mChance;
39
-	public BiomeNameSet mBiomes = new BiomeNameSet();
40
+	public BiomeNameSet mTargetBiomes = new BiomeNameSet();
41
+	/** No longer in use, did not work before anyways. */
42
+	@Deprecated public ArrayList<String> mBiomes = new ArrayList<>();
40 43
 	
41 44
 	public StoneLayerOres(OreDictMaterial aMaterial, long aChance, int aMinY, int aMaxY) {
42 45
 		mMaterial = (aMaterial != null && aMaterial.mID > 0 ? aMaterial : MT.Empty);
@@ -45,20 +48,20 @@ public class StoneLayerOres {
45 48
 	}
46 49
 	public StoneLayerOres(OreDictMaterial aMaterial, long aChance, int aMinY, int aMaxY, Collection<String> aBiomes) {
47 50
 		this(aMaterial, aChance, aMinY, aMaxY);
48
-		mBiomes.addAll(aBiomes);
51
+		mTargetBiomes.addAll(aBiomes);
49 52
 	}
50 53
 	
51 54
 	@SuppressWarnings("unlikely-arg-type")
52 55
 	public boolean check(StoneLayer aLayer, World aWorld, int aX, int aY, int aZ, BiomeGenBase aBiome, int aRandomNumber) {
53
-		return aY >= mMinY && aY <= mMaxY && aRandomNumber           < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome));
56
+		return aY >= mMinY && aY <= mMaxY && aRandomNumber           < mChance && (mTargetBiomes.isEmpty() || mTargetBiomes.contains(aBiome));
54 57
 	}
55 58
 	@SuppressWarnings("unlikely-arg-type")
56 59
 	public boolean check(StoneLayer aLayer, World aWorld, int aX, int aY, int aZ, BiomeGenBase aBiome, Random aRandom) {
57
-		return aY >= mMinY && aY <= mMaxY && aRandom.nextInt((int)U) < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome));
60
+		return aY >= mMinY && aY <= mMaxY && aRandom.nextInt((int)U) < mChance && (mTargetBiomes.isEmpty() || mTargetBiomes.contains(aBiome));
58 61
 	}
59 62
 	@SuppressWarnings("unlikely-arg-type")
60 63
 	public boolean check(StoneLayer aLayer, World aWorld, int aX, int aY, int aZ, BiomeGenBase aBiome) {
61
-		return aY >= mMinY && aY <= mMaxY && RNGSUS .nextInt((int)U) < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome));
64
+		return aY >= mMinY && aY <= mMaxY && RNGSUS .nextInt((int)U) < mChance && (mTargetBiomes.isEmpty() || mTargetBiomes.contains(aBiome));
62 65
 	}
63 66
 	
64 67
 	public boolean set(StoneLayer aLayer, World aWorld, int aX, int aY, int aZ, BiomeGenBase aBiome, Random aRandom) {

Loading…
Cancel
Save