Fixed surface gen in UmbraValleyBiome
This commit is contained in:
parent
338aee76e9
commit
5c12813b3e
5 changed files with 79 additions and 22 deletions
|
@ -26,6 +26,11 @@ public class EndBiome extends BCLBiome {
|
||||||
protected static final SurfaceRules.RuleSource FLAVOLITE =SurfaceRules.state(EndBlocks.FLAVOLITE.stone.defaultBlockState());
|
protected static final SurfaceRules.RuleSource FLAVOLITE =SurfaceRules.state(EndBlocks.FLAVOLITE.stone.defaultBlockState());
|
||||||
protected static final SurfaceRules.RuleSource SULPHURIC_ROCK =SurfaceRules.state(EndBlocks.SULPHURIC_ROCK.stone.defaultBlockState());
|
protected static final SurfaceRules.RuleSource SULPHURIC_ROCK =SurfaceRules.state(EndBlocks.SULPHURIC_ROCK.stone.defaultBlockState());
|
||||||
protected static final SurfaceRules.RuleSource BRIMSTONE =SurfaceRules.state(EndBlocks.BRIMSTONE.defaultBlockState());
|
protected static final SurfaceRules.RuleSource BRIMSTONE =SurfaceRules.state(EndBlocks.BRIMSTONE.defaultBlockState());
|
||||||
|
protected static final SurfaceRules.RuleSource PALLIDIUM_FULL =SurfaceRules.state(EndBlocks.PALLIDIUM_FULL.defaultBlockState());
|
||||||
|
protected static final SurfaceRules.RuleSource PALLIDIUM_HEAVY =SurfaceRules.state(EndBlocks.PALLIDIUM_HEAVY.defaultBlockState());
|
||||||
|
protected static final SurfaceRules.RuleSource PALLIDIUM_THIN =SurfaceRules.state(EndBlocks.PALLIDIUM_THIN.defaultBlockState());
|
||||||
|
protected static final SurfaceRules.RuleSource PALLIDIUM_TINY =SurfaceRules.state(EndBlocks.PALLIDIUM_TINY.defaultBlockState());
|
||||||
|
protected static final SurfaceRules.RuleSource UMBRALITH =SurfaceRules.state(EndBlocks.UMBRALITH.stone.defaultBlockState());
|
||||||
|
|
||||||
public final ResourceLocation ID;
|
public final ResourceLocation ID;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class SulphurSpringsBiome extends EndBiome.Config {
|
||||||
@Override
|
@Override
|
||||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||||
builder
|
builder
|
||||||
//TODO: 1.18 surface Rules
|
//TODO: 1.18 check surface Rules
|
||||||
//.surface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
|
//.surface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
|
||||||
.surface(
|
.surface(
|
||||||
SurfaceRules.sequence(
|
SurfaceRules.sequence(
|
||||||
|
|
|
@ -1,29 +1,41 @@
|
||||||
package ru.betterend.world.biome.land;
|
package ru.betterend.world.biome.land;
|
||||||
|
|
||||||
|
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
import ru.betterend.registry.EndParticles;
|
import ru.betterend.registry.EndParticles;
|
||||||
import ru.betterend.registry.EndSounds;
|
import ru.betterend.registry.EndSounds;
|
||||||
import ru.betterend.world.biome.EndBiome;
|
import ru.betterend.world.biome.EndBiome;
|
||||||
|
import ru.betterend.world.surface.UmbraSurfaceNoiseCondition;
|
||||||
|
|
||||||
public class UmbraValleyBiome extends EndBiome.Config {
|
public class UmbraValleyBiome extends EndBiome.Config {
|
||||||
public UmbraValleyBiome() {
|
public UmbraValleyBiome() {
|
||||||
super("umbra_valley");
|
super("umbra_valley");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||||
builder.fogColor(100, 100, 100)
|
builder.fogColor(100, 100, 100)
|
||||||
.plantsColor(172, 189, 190)
|
.plantsColor(172, 189, 190)
|
||||||
.waterAndFogColor(69, 104, 134)
|
.waterAndFogColor(69, 104, 134)
|
||||||
//TODO: 1.18 surface Rules
|
//TODO: 1.18 check surface Rules
|
||||||
//.surface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
|
//.surface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
|
||||||
.particles(EndParticles.AMBER_SPHERE, 0.0001F)
|
.surface(
|
||||||
.loop(EndSounds.UMBRA_VALLEY)
|
SurfaceRules.sequence(
|
||||||
.music(EndSounds.MUSIC_DARK)
|
SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, SurfaceRules.sequence(
|
||||||
.feature(EndFeatures.UMBRALITH_ARCH)
|
SurfaceRules.ifTrue(new UmbraSurfaceNoiseCondition(0.4), PALLIDIUM_FULL),
|
||||||
.feature(EndFeatures.THIN_UMBRALITH_ARCH)
|
SurfaceRules.ifTrue(new UmbraSurfaceNoiseCondition(0.15), PALLIDIUM_HEAVY),
|
||||||
.feature(EndFeatures.INFLEXIA)
|
SurfaceRules.ifTrue(new UmbraSurfaceNoiseCondition(-0.15), PALLIDIUM_THIN),
|
||||||
.feature(EndFeatures.FLAMMALIX);
|
SurfaceRules.ifTrue(new UmbraSurfaceNoiseCondition(-0.4), PALLIDIUM_TINY)
|
||||||
}
|
)), UMBRALITH
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.particles(EndParticles.AMBER_SPHERE, 0.0001F)
|
||||||
|
.loop(EndSounds.UMBRA_VALLEY)
|
||||||
|
.music(EndSounds.MUSIC_DARK)
|
||||||
|
.feature(EndFeatures.UMBRALITH_ARCH)
|
||||||
|
.feature(EndFeatures.THIN_UMBRALITH_ARCH)
|
||||||
|
.feature(EndFeatures.INFLEXIA)
|
||||||
|
.feature(EndFeatures.FLAMMALIX);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,10 @@ public class SulphuricSurfaceNoiseCondition extends SurfaceNoiseCondition {
|
||||||
this.threshold = threshold;
|
this.threshold = threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int lastX = Integer.MIN_VALUE;
|
private static int lastX = Integer.MIN_VALUE;
|
||||||
private int lastZ = Integer.MIN_VALUE;
|
private static int lastZ = Integer.MIN_VALUE;
|
||||||
private double lastValue = 0;
|
private static double lastValue = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean test(SurfaceRulesContextAccessor context) {
|
public boolean test(SurfaceRulesContextAccessor context) {
|
||||||
final int x = context.getBlockX();
|
final int x = context.getBlockX();
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package ru.betterend.world.surface;
|
||||||
|
|
||||||
|
import ru.bclib.api.biomes.SurfaceNoiseCondition;
|
||||||
|
import ru.bclib.mixin.common.SurfaceRulesContextAccessor;
|
||||||
|
import ru.bclib.util.MHelper;
|
||||||
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
|
|
||||||
|
public class UmbraSurfaceNoiseCondition extends SurfaceNoiseCondition {
|
||||||
|
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(1512);
|
||||||
|
|
||||||
|
private final double threshold;
|
||||||
|
public UmbraSurfaceNoiseCondition(double threshold){
|
||||||
|
this.threshold = threshold;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int lastX = Integer.MIN_VALUE;
|
||||||
|
private static int lastZ = Integer.MIN_VALUE;
|
||||||
|
private static double lastValue = 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean test(SurfaceRulesContextAccessor context) {
|
||||||
|
final int x = context.getBlockX();
|
||||||
|
final int z = context.getBlockZ();
|
||||||
|
if (lastX==x && lastZ==z) return lastValue > threshold;
|
||||||
|
|
||||||
|
double value = NOISE.eval(x * 0.03, z * 0.03) + NOISE.eval(x * 0.1, z * 0.1) * 0.3 + MHelper.randRange(
|
||||||
|
-0.1,
|
||||||
|
0.1,
|
||||||
|
MHelper.RANDOM
|
||||||
|
);
|
||||||
|
|
||||||
|
lastX=x;
|
||||||
|
lastZ=z;
|
||||||
|
lastValue=value;
|
||||||
|
return value > threshold;
|
||||||
|
//int depth = (int) (NOISE.eval(x * 0.1, z * 0.1) * 20 + NOISE.eval(x * 0.5, z * 0.5) * 10 + 60);
|
||||||
|
//SurfaceBuilder.DEFAULT.apply(random, chunk, biome, x, z, height, noise + depth, defaultBlock, defaultFluid, seaLevel, seed, n, config);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue