Browse Source

Fixed Biome dependent Stone LAyer Ores not generating

Gregorius Techneticies 2 months ago
parent
commit
b4e189310a
Signed by: Gregorius Techneticies <gregoriustech@gmail.com> GPG Key ID: 1B693EA14F2FD70F

+ 1
- 0
CHANGELOG.md View File

@@ -13,6 +13,7 @@ Nothing (I tend to only add finished Stuff to the Changelog).
13 13
 [NOTE] The Default Config Pack updated to disable Fastcrafts Chunk Culling, so that Ocean Floors are now rendering properly again. Set "enableCullingTweaks" to false in the "config/fastcraft.ini" File, if you experience this Issue.
14 14
 [COMPAT] Aroma1997's Mining Dimension is now Compatible with my Worldgen.
15 15
 [COMPAT] Et Futurum Requiem is now supported properly and up to date. Its Netherite Items and Ore Blocks are preferred over the ones of Netherite Plus. https://www.curseforge.com/minecraft/mc-mods/et-futurum-requiem/files
16
+[FIXED] Biome dependent Stone LAyer Ores were not generating at all, due to me forgetting to Lowercase the Biome Names.
16 17
 [FIXED] Infinite Worldgen Loop with Oceans, because I forgot to set the Block Update Flag to 2 during Worldgen, because ofcourse I left it to default when I fixed another Ocean related Bug...
17 18
 [FIXED] Coal and Oil Shale Stone Layer Ore Blocks were flammable t othe point of burning up way too much. Now they are still flammable but Fire wont spread to them.
18 19
 [FIXED] Railcraft Crowbars should now be able to remove Covers again, even if they dont use the overlay for technical reasons.

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

@@ -21,10 +21,10 @@ package gregapi.worldgen;
21 21
 
22 22
 import static gregapi.data.CS.*;
23 23
 
24
-import java.util.ArrayList;
25 24
 import java.util.Collection;
26 25
 import java.util.Random;
27 26
 
27
+import gregapi.code.BiomeNameSet;
28 28
 import gregapi.data.MT;
29 29
 import gregapi.oredict.OreDictMaterial;
30 30
 import gregapi.util.UT;
@@ -36,7 +36,7 @@ public class StoneLayerOres {
36 36
 	public OreDictMaterial mMaterial;
37 37
 	/** The Material Amount will determine the chance in the form of an X of U Chance. */
38 38
 	public long mChance;
39
-	public ArrayList<String> mBiomes = new ArrayList<>();
39
+	public BiomeNameSet mBiomes = new BiomeNameSet();
40 40
 	
41 41
 	public StoneLayerOres(OreDictMaterial aMaterial, long aChance, int aMinY, int aMaxY) {
42 42
 		mMaterial = (aMaterial != null && aMaterial.mID > 0 ? aMaterial : MT.Empty);
@@ -48,15 +48,19 @@ public class StoneLayerOres {
48 48
 		mBiomes.addAll(aBiomes);
49 49
 	}
50 50
 	
51
+	@SuppressWarnings("unlikely-arg-type")
51 52
 	public boolean check(StoneLayer aLayer, World aWorld, int aX, int aY, int aZ, BiomeGenBase aBiome, int aRandomNumber) {
52
-		return aY >= mMinY && aY <= mMaxY && aRandomNumber           < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome.biomeName));
53
+		return aY >= mMinY && aY <= mMaxY && aRandomNumber           < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome));
53 54
 	}
55
+	@SuppressWarnings("unlikely-arg-type")
54 56
 	public boolean check(StoneLayer aLayer, World aWorld, int aX, int aY, int aZ, BiomeGenBase aBiome, Random aRandom) {
55
-		return aY >= mMinY && aY <= mMaxY && aRandom.nextInt((int)U) < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome.biomeName));
57
+		return aY >= mMinY && aY <= mMaxY && aRandom.nextInt((int)U) < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome));
56 58
 	}
59
+	@SuppressWarnings("unlikely-arg-type")
57 60
 	public boolean check(StoneLayer aLayer, World aWorld, int aX, int aY, int aZ, BiomeGenBase aBiome) {
58
-		return aY >= mMinY && aY <= mMaxY && RNGSUS .nextInt((int)U) < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome.biomeName));
61
+		return aY >= mMinY && aY <= mMaxY && RNGSUS .nextInt((int)U) < mChance && (mBiomes.isEmpty() || mBiomes.contains(aBiome));
59 62
 	}
63
+	
60 64
 	public boolean set(StoneLayer aLayer, World aWorld, int aX, int aY, int aZ, BiomeGenBase aBiome, Random aRandom) {
61 65
 		return aY == mMinY || aY == mMaxY || aRandom.nextBoolean() ? small(aLayer, aWorld, aX, aY, aZ, aBiome) : normal(aLayer, aWorld, aX, aY, aZ, aBiome);
62 66
 	}

+ 6
- 6
src/main/java/gregtech/loaders/b/Loader_Worldgen.java View File

@@ -455,16 +455,16 @@ public class Loader_Worldgen implements Runnable {
455 455
 		
456 456
 		
457 457
 		StoneLayer.bothsides(MT.Coal, MT.Stone
458
-		, new StoneLayerOres(MT.Amber                   , U  , 30, 70, BIOMES_OCEAN_BEACH)
459
-		, new StoneLayerOres(MT.AmberDominican          , U  , 30, 70, BIOMES_RIVER_LAKE)
458
+		, new StoneLayerOres(MT.Amber                   , U4 , 30, 70, BIOMES_OCEAN_BEACH)
459
+		, new StoneLayerOres(MT.AmberDominican          , U8 , 30, 70, BIOMES_RIVER_LAKE)
460 460
 		);
461 461
 		StoneLayer.bothsides(MT.Lignite, MT.Stone
462
-		, new StoneLayerOres(MT.Amber                   , U  , 30, 70, BIOMES_OCEAN_BEACH)
463
-		, new StoneLayerOres(MT.AmberDominican          , U  , 30, 70, BIOMES_RIVER_LAKE)
462
+		, new StoneLayerOres(MT.Amber                   , U4 , 30, 70, BIOMES_OCEAN_BEACH)
463
+		, new StoneLayerOres(MT.AmberDominican          , U8 , 30, 70, BIOMES_RIVER_LAKE)
464 464
 		);
465 465
 		StoneLayer.bothsides(MT.Oilshale, MT.Stone
466
-		, new StoneLayerOres(MT.Amber                   , U  , 30, 70, BIOMES_OCEAN_BEACH)
467
-		, new StoneLayerOres(MT.AmberDominican          , U  , 30, 70, BIOMES_RIVER_LAKE)
466
+		, new StoneLayerOres(MT.Amber                   , U4 , 30, 70, BIOMES_OCEAN_BEACH)
467
+		, new StoneLayerOres(MT.AmberDominican          , U8 , 30, 70, BIOMES_RIVER_LAKE)
468 468
 		);
469 469
 		StoneLayer.bothsides(MT.Komatiite, MT.Stone
470 470
 		, new StoneLayerOres(MT.Redstone                , U8 ,  0, 30)

Loading…
Cancel
Save