Browse Source

This should fix worldgen being identical for rock layers

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

+ 1
- 0
src/main/java/gregapi/recipes/handlers/RecipeMapHandlerCrushing.java View File

@@ -135,6 +135,7 @@ public class RecipeMapHandlerCrushing extends RecipeMapHandler {
135 135
 	
136 136
 	@Override
137 137
 	public boolean containsInput(RecipeMap aMap, ItemStack aStack, OreDictItemData aData) {
138
+		// For some Reason it requires this to let Items in, even if it should actually be able to find the Recipe.
138 139
 		return (aData != null && ST.block(aStack) instanceof IPrefixBlock && aData.mPrefix.contains(TD.Prefix.STANDARD_ORE)) || super.containsInput(aMap, aStack, aData);
139 140
 	}
140 141
 	

+ 8
- 3
src/main/java/gregtech/worldgen/NoiseGenerator.java View File

@@ -22,14 +22,15 @@ package gregtech.worldgen;
22 22
 import net.minecraft.world.World;
23 23
 
24 24
 public class NoiseGenerator {
25
-	public int mSeed = 42;
25
+	public int mSeed = 42, mOffsetY = 0;
26 26
 	private float mFrequencyX = 0.009F, mFrequencyY = 0.075F, mFrequencyZ = 0.009F;
27 27
 	
28 28
 	public NoiseGenerator(long aSeed) {
29 29
 		mSeed = (int)aSeed;
30 30
 	}
31 31
 	public NoiseGenerator(World aWorld) {
32
-		mSeed = (int)(aWorld.getSeed() ^ aWorld.provider.dimensionId);
32
+		mOffsetY = 512 * aWorld.provider.dimensionId;
33
+		mSeed = (int)aWorld.getSeed();
33 34
 	}
34 35
 	public NoiseGenerator setFrequency(float aFrequency) {
35 36
 		mFrequencyX = aFrequency;
@@ -51,7 +52,11 @@ public class NoiseGenerator {
51 52
 	
52 53
 	/** @return a Number between -1.0F and +1.0F. Hitting exactly +-1.0F is extremely unlikely, but possible. */
53 54
 	public float get(float aX, float aY, float aZ) {
54
-		aX *= mFrequencyX; aY *= mFrequencyY; aZ *= mFrequencyZ;
55
+		aY += mOffsetY;
56
+		aX *= mFrequencyX;
57
+		aY *= mFrequencyY;
58
+		aZ *= mFrequencyZ;
59
+		
55 60
 		int xr = Math.round(aX), yr = Math.round(aY), zr = Math.round(aZ), xc = 0, yc = 0, zc = 0;
56 61
 		float distance = 999999;
57 62
 		

Loading…
Cancel
Save