fixed bug where erosion decorator created ridges on chunk edges (when strata decorator is disabled)

This commit is contained in:
dags- 2020-03-15 22:07:40 +00:00
parent 8bfbbc5276
commit 26c20e7995
6 changed files with 6 additions and 9 deletions

View File

@ -43,7 +43,6 @@ import net.minecraft.world.gen.feature.structure.Structure;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;

View File

@ -27,8 +27,8 @@ package com.terraforged.mod.chunk.test;
import com.terraforged.core.world.terrain.Terrain;
import com.terraforged.core.world.terrain.Terrains;
import com.terraforged.mod.biome.ModBiomes;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
public class Test {
@ -39,6 +39,6 @@ public class Test {
}
public static Biome getBiome() {
return ModBiomes.TAIGA_SCRUB;
return Biomes.PLAINS;
}
}

View File

@ -55,7 +55,7 @@ public class TestChunkGenerator extends TerraChunkGenerator {
.pool(ThreadPool.getFixed())
.size(3, 2)
.build()
.toCache(true);
.toCache(false);
}
@Override

View File

@ -111,7 +111,7 @@ public class ErosionDecorator implements ColumnDecorator {
BlockState material = Blocks.GRAVEL.getDefaultState();
// find the uppermost layer of rock & record it's depth
for (int dy = 3; dy < 32; dy++) {
context.pos.setY(y - dy);
context.pos.setPos(dx, y - dy, dz);
BlockState state = chunk.getBlockState(context.pos);
if (materials.isStone(state.getBlock())) {
material = state;
@ -122,7 +122,7 @@ public class ErosionDecorator implements ColumnDecorator {
// fill downwards to the first rock layer
for (int dy = 0; dy < depth; dy++) {
context.pos.setY(y - dy);
context.pos.setPos(dx, y - dy, dz);
chunk.setBlockState(context.pos, material, false);
}
}

View File

@ -75,7 +75,7 @@ public class SnowEroder extends ErosionDecorator {
if (snowErosion(x, z, steepness, height)) {
Predicate<BlockState> predicate = Heightmap.Type.MOTION_BLOCKING.getHeightLimitPredicate();
for (int dy = 2; dy > 0; dy--) {
context.pos.setY(y + dy);
context.pos.setPos(x, y + dy, z);
BlockState state = chunk.getBlockState(context.pos);
if (!predicate.test(state) || state.getBlock() == Blocks.SNOW) {
chunk.setBlockState(context.pos, Blocks.AIR.getDefaultState(), false);

View File

@ -34,8 +34,6 @@ import net.minecraft.block.SaplingBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.NoFeatureConfig;