Skip to content

Commit

Permalink
Merge pull request #16 from BTW-Community/dev
Browse files Browse the repository at this point in the history
1.4.2
  • Loading branch information
ammoore00 authored Apr 6, 2021
2 parents fe1e141 + 0607dfb commit bfc4b97
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 50 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 1.4.2
[list]
[*]Fixed an issue where any changes using random generators would result in the terrain noise being initialized in a different way, causing large world seams if anything was changed (to the point where unrelated mods could affect the generation). This only affected 1.4.X worlds so older worlds are fine. However, the fix for this necessitated causing one more world seam, so any worlds that were generated with 1.4.0 or 1.4.1 will have different generation now. I apologize for any inconvenience this may have caused, but damage should be minimal given the same day release and the fact that old worlds were unaffected by the bug as they do not use the new generator system that 1.4.X worlds do.
[*]Fixed an issue where frozen beaches and red sand beaches would spawn normal beachs at their edges.
[/list]

Version 1.4.1
[list]
[*]Fixed an issue where some of the changes to badlands edges were not checking the world version and thus could create seams.
Expand Down
Binary file modified reobf/minecraft/BTABiomeConfiguration.class
Binary file not shown.
Binary file modified reobf/minecraft/BTAChunkProvider.class
Binary file not shown.
Binary file modified reobf/minecraft/BTAEnumVersionCompat.class
Binary file not shown.
Binary file modified reobf/minecraft/BTAMod.class
Binary file not shown.
Binary file modified reobf/minecraft/BTASurfaceBuilder.class
Binary file not shown.
Binary file modified reobf/minecraft_server/BTAChunkProvider.class
Binary file not shown.
Binary file modified reobf/minecraft_server/BTAEnumVersionCompat.class
Binary file not shown.
Binary file modified reobf/minecraft_server/BTAMod.class
Binary file not shown.
Binary file modified reobf/minecraft_server/BTASurfaceBuilder.class
Binary file not shown.
4 changes: 2 additions & 2 deletions src/minecraft/net/minecraft/src/BTABiomeConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,10 @@ else if (BiomeGenBase.biomeList[baseBiome].getEnableSnow()) {
public static int getBeachVariantForBiomes(int baseBiome, BTAWorldConfigurationInfo generatorInfo) {
int beachBiome = -1;

if (baseBiome == outback.biomeID || baseBiome == badlands.biomeID) {
if (baseBiome == outback.biomeID || baseBiome == badlands.biomeID || baseBiome == beachOutback.biomeID) {
beachBiome = beachOutback.biomeID;
}
else if ((baseBiome == snowyWoods.biomeID || baseBiome == tundra.biomeID || baseBiome == siberia.biomeID || baseBiome == frozenSprings.biomeID) && generatorInfo.getCompatMode().isVersionAtLeast(BTAEnumVersionCompat.V1_3_2)) {
else if ((baseBiome == snowyWoods.biomeID || baseBiome == tundra.biomeID || baseBiome == siberia.biomeID || baseBiome == frozenSprings.biomeID || baseBiome == beachFrozen.biomeID) && generatorInfo.getCompatMode().isVersionAtLeast(BTAEnumVersionCompat.V1_3_2)) {
beachBiome = beachFrozen.biomeID;
}
else if (shouldBiomeSpawnBeach(baseBiome, generatorInfo)) {
Expand Down
14 changes: 8 additions & 6 deletions src/minecraft/net/minecraft/src/BTAChunkProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,22 @@ public class BTAChunkProvider implements IChunkProvider
private long seed;
private int parabolicRadius = 2;

public BTAChunkProvider(World par1World, long par2, boolean par4, BTAWorldConfigurationInfo generatorInfo)
public BTAChunkProvider(World world, long seed, boolean mapFeaturesEnabled, BTAWorldConfigurationInfo generatorInfo)
{
this.worldObj = par1World;
this.mapFeaturesEnabled = par4;
this.rand = new Random(par2);
this.m_structureRand = new Random(par2);
this.worldObj = world;
this.mapFeaturesEnabled = mapFeaturesEnabled;
this.rand = new Random(seed);
this.m_structureRand = new Random(seed);
this.generatorInfo = generatorInfo;
this.blockNoiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
this.blockNoiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
this.blockModifierNoiseGen = new NoiseGeneratorOctaves(this.rand, 8);
this.soilDepthNoiseGen = new NoiseGeneratorOctaves(this.rand, 4);
this.biomeHeightNoiseGen = new NoiseGeneratorOctaves(this.rand, 16);
this.sandNoiseGen = new BTABetaNoiseOctaves(this.rand, 4);
this.seed = par2;
this.seed = seed;

BTASurfaceBuilder.initForNoiseField(this.seed);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/minecraft/net/minecraft/src/BTAEnumVersionCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public enum BTAEnumVersionCompat {
V1_3_3(1, 3, 3),
V1_3_4(1, 3, 4),
V1_4_0(1, 4, 0),
V1_4_1(1, 4, 1);
V1_4_1(1, 4, 1),
V1_4_2(1, 4, 2);

private final int major;
private final int minor;
Expand Down
2 changes: 1 addition & 1 deletion src/minecraft/net/minecraft/src/BTAMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BTAMod extends AddonExt {
public static final WorldType BTAWorldTypeHorizons = new BTAWorldTypeHorizons(15, "BTAHorizons").setCanBeCreated(false);

private BTAMod() {
super("Better Terrain", "1.4.1", "BTA");
super("Better Terrain", "1.4.2", "BTA");
this.currentVersion = BTAEnumVersionCompat.fromString(this.getVersionString());
}

Expand Down
31 changes: 15 additions & 16 deletions src/minecraft/net/minecraft/src/BTASurfaceBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,23 @@ public static void generateTrees(World world, Random rand, BTAWorldConfiguration
legacyBuilder.generateTreesForBiome(world, rand, chunkX, chunkZ, biome, generatorInfo);
}
}

public static void initForNoiseField(long seed) {
Random rand = new Random(seed);

if (blockNoiseGen1 == null)
blockNoiseGen1 = new NoiseGeneratorOctaves(rand, 16);
if (blockNoiseGen2 == null)
blockNoiseGen2 = new NoiseGeneratorOctaves(rand, 16);
if (blockModifierNoiseGen == null)
blockModifierNoiseGen = new NoiseGeneratorOctaves(rand, 8);
if (soilDepthNoiseGen == null)
soilDepthNoiseGen = new NoiseGeneratorOctaves(rand, 4);
if (biomeHeightNoiseGen == null)
biomeHeightNoiseGen = new NoiseGeneratorOctaves(rand, 16);
}

public static double[] initializeNoiseField(Random rand, long seed, double[] noiseArray, int posX, int posY, int posZ, int sizeX, int sizeY, int sizeZ, BiomeGenBase[] biomesForGeneration) {
if (!defaultBuilder.hasBeenInit) {
defaultBuilder.init(rand, seed);
defaultBuilder.hasBeenInit = true;
}

if (noiseArray == null) {
noiseArray = new double[sizeX * sizeY * sizeZ];
}
Expand Down Expand Up @@ -259,17 +269,6 @@ else if (blockNoiseModifierSample > 1.0D) {
}

protected void init(Random rand, long seed) {
if (soilDepthNoiseGen == null)
soilDepthNoiseGen = new NoiseGeneratorOctaves(rand, 4);
if (blockNoiseGen1 == null)
blockNoiseGen1 = new NoiseGeneratorOctaves(rand, 16);
if (blockNoiseGen2 == null)
blockNoiseGen2 = new NoiseGeneratorOctaves(rand, 16);
if (blockModifierNoiseGen == null)
blockModifierNoiseGen = new NoiseGeneratorOctaves(rand, 8);
if (biomeHeightNoiseGen == null)
biomeHeightNoiseGen = new NoiseGeneratorOctaves(rand, 16);

Random sandRand = new Random(seed - 1000);

if (sandNoiseGenSimplex == null)
Expand Down
14 changes: 8 additions & 6 deletions src/minecraft_server/net/minecraft/src/BTAChunkProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,22 @@ public class BTAChunkProvider implements IChunkProvider
private long seed;
private int parabolicRadius = 2;

public BTAChunkProvider(World par1World, long par2, boolean par4, BTAWorldConfigurationInfo generatorInfo)
public BTAChunkProvider(World world, long seed, boolean mapFeaturesEnabled, BTAWorldConfigurationInfo generatorInfo)
{
this.worldObj = par1World;
this.mapFeaturesEnabled = par4;
this.rand = new Random(par2);
this.m_structureRand = new Random(par2);
this.worldObj = world;
this.mapFeaturesEnabled = mapFeaturesEnabled;
this.rand = new Random(seed);
this.m_structureRand = new Random(seed);
this.generatorInfo = generatorInfo;
this.blockNoiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
this.blockNoiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);
this.blockModifierNoiseGen = new NoiseGeneratorOctaves(this.rand, 8);
this.soilDepthNoiseGen = new NoiseGeneratorOctaves(this.rand, 4);
this.biomeHeightNoiseGen = new NoiseGeneratorOctaves(this.rand, 16);
this.sandNoiseGen = new BTABetaNoiseOctaves(this.rand, 4);
this.seed = par2;
this.seed = seed;

BTASurfaceBuilder.initForNoiseField(this.seed);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public enum BTAEnumVersionCompat {
V1_3_3(1, 3, 3),
V1_3_4(1, 3, 4),
V1_4_0(1, 4, 0),
V1_4_1(1, 4, 1);
V1_4_1(1, 4, 1),
V1_4_2(1, 4, 2);

private final int major;
private final int minor;
Expand Down
2 changes: 1 addition & 1 deletion src/minecraft_server/net/minecraft/src/BTAMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BTAMod extends AddonExt {
public static final WorldType BTAWorldTypeHorizons = new BTAWorldTypeHorizons(15, "BTAHorizons").setCanBeCreated(false);

private BTAMod() {
super("Better Terrain", "1.4.1", "BTA");
super("Better Terrain", "1.4.2", "BTA");
this.currentVersion = BTAEnumVersionCompat.fromString(this.getVersionString());
}

Expand Down
31 changes: 15 additions & 16 deletions src/minecraft_server/net/minecraft/src/BTASurfaceBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,23 @@ public static void generateTrees(World world, Random rand, BTAWorldConfiguration
legacyBuilder.generateTreesForBiome(world, rand, chunkX, chunkZ, biome, generatorInfo);
}
}

public static void initForNoiseField(long seed) {
Random rand = new Random(seed);

if (blockNoiseGen1 == null)
blockNoiseGen1 = new NoiseGeneratorOctaves(rand, 16);
if (blockNoiseGen2 == null)
blockNoiseGen2 = new NoiseGeneratorOctaves(rand, 16);
if (blockModifierNoiseGen == null)
blockModifierNoiseGen = new NoiseGeneratorOctaves(rand, 8);
if (soilDepthNoiseGen == null)
soilDepthNoiseGen = new NoiseGeneratorOctaves(rand, 4);
if (biomeHeightNoiseGen == null)
biomeHeightNoiseGen = new NoiseGeneratorOctaves(rand, 16);
}

public static double[] initializeNoiseField(Random rand, long seed, double[] noiseArray, int posX, int posY, int posZ, int sizeX, int sizeY, int sizeZ, BiomeGenBase[] biomesForGeneration) {
if (!defaultBuilder.hasBeenInit) {
defaultBuilder.init(rand, seed);
defaultBuilder.hasBeenInit = true;
}

if (noiseArray == null) {
noiseArray = new double[sizeX * sizeY * sizeZ];
}
Expand Down Expand Up @@ -259,17 +269,6 @@ else if (blockNoiseModifierSample > 1.0D) {
}

protected void init(Random rand, long seed) {
if (soilDepthNoiseGen == null)
soilDepthNoiseGen = new NoiseGeneratorOctaves(rand, 4);
if (blockNoiseGen1 == null)
blockNoiseGen1 = new NoiseGeneratorOctaves(rand, 16);
if (blockNoiseGen2 == null)
blockNoiseGen2 = new NoiseGeneratorOctaves(rand, 16);
if (blockModifierNoiseGen == null)
blockModifierNoiseGen = new NoiseGeneratorOctaves(rand, 8);
if (biomeHeightNoiseGen == null)
biomeHeightNoiseGen = new NoiseGeneratorOctaves(rand, 16);

Random sandRand = new Random(seed - 1000);

if (sandNoiseGenSimplex == null)
Expand Down

0 comments on commit bfc4b97

Please sign in to comment.