fixed bug where erosion decorator created ridges on chunk edges (when strata decorator is disabled)
This commit is contained in:
parent
8bfbbc5276
commit
26c20e7995
@ -43,7 +43,6 @@ import net.minecraft.world.gen.feature.structure.Structure;
|
|||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
@ -27,8 +27,8 @@ package com.terraforged.mod.chunk.test;
|
|||||||
|
|
||||||
import com.terraforged.core.world.terrain.Terrain;
|
import com.terraforged.core.world.terrain.Terrain;
|
||||||
import com.terraforged.core.world.terrain.Terrains;
|
import com.terraforged.core.world.terrain.Terrains;
|
||||||
import com.terraforged.mod.biome.ModBiomes;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
|
import net.minecraft.world.biome.Biomes;
|
||||||
|
|
||||||
public class Test {
|
public class Test {
|
||||||
|
|
||||||
@ -39,6 +39,6 @@ public class Test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Biome getBiome() {
|
public static Biome getBiome() {
|
||||||
return ModBiomes.TAIGA_SCRUB;
|
return Biomes.PLAINS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ public class TestChunkGenerator extends TerraChunkGenerator {
|
|||||||
.pool(ThreadPool.getFixed())
|
.pool(ThreadPool.getFixed())
|
||||||
.size(3, 2)
|
.size(3, 2)
|
||||||
.build()
|
.build()
|
||||||
.toCache(true);
|
.toCache(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -111,7 +111,7 @@ public class ErosionDecorator implements ColumnDecorator {
|
|||||||
BlockState material = Blocks.GRAVEL.getDefaultState();
|
BlockState material = Blocks.GRAVEL.getDefaultState();
|
||||||
// find the uppermost layer of rock & record it's depth
|
// find the uppermost layer of rock & record it's depth
|
||||||
for (int dy = 3; dy < 32; dy++) {
|
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);
|
BlockState state = chunk.getBlockState(context.pos);
|
||||||
if (materials.isStone(state.getBlock())) {
|
if (materials.isStone(state.getBlock())) {
|
||||||
material = state;
|
material = state;
|
||||||
@ -122,7 +122,7 @@ public class ErosionDecorator implements ColumnDecorator {
|
|||||||
|
|
||||||
// fill downwards to the first rock layer
|
// fill downwards to the first rock layer
|
||||||
for (int dy = 0; dy < depth; dy++) {
|
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);
|
chunk.setBlockState(context.pos, material, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class SnowEroder extends ErosionDecorator {
|
|||||||
if (snowErosion(x, z, steepness, height)) {
|
if (snowErosion(x, z, steepness, height)) {
|
||||||
Predicate<BlockState> predicate = Heightmap.Type.MOTION_BLOCKING.getHeightLimitPredicate();
|
Predicate<BlockState> predicate = Heightmap.Type.MOTION_BLOCKING.getHeightLimitPredicate();
|
||||||
for (int dy = 2; dy > 0; dy--) {
|
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);
|
BlockState state = chunk.getBlockState(context.pos);
|
||||||
if (!predicate.test(state) || state.getBlock() == Blocks.SNOW) {
|
if (!predicate.test(state) || state.getBlock() == Blocks.SNOW) {
|
||||||
chunk.setBlockState(context.pos, Blocks.AIR.getDefaultState(), false);
|
chunk.setBlockState(context.pos, Blocks.AIR.getDefaultState(), false);
|
||||||
|
@ -34,8 +34,6 @@ import net.minecraft.block.SaplingBlock;
|
|||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3i;
|
import net.minecraft.util.math.Vec3i;
|
||||||
import net.minecraft.world.IWorld;
|
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.ChunkGenerator;
|
||||||
import net.minecraft.world.gen.feature.Feature;
|
import net.minecraft.world.gen.feature.Feature;
|
||||||
import net.minecraft.world.gen.feature.NoFeatureConfig;
|
import net.minecraft.world.gen.feature.NoFeatureConfig;
|
||||||
|
Loading…
Reference in New Issue
Block a user