Sulphur Springs fixes

This commit is contained in:
paulevsGitch 2021-12-23 20:25:26 +03:00
parent a25a02592a
commit a5e203acb3
3 changed files with 58 additions and 61 deletions

View file

@ -20,7 +20,8 @@ public class ChorusForestBiome extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
builder.fogColor(87, 26, 87)
builder
.fogColor(87, 26, 87)
.fogDensity(1.5F)
.plantsColor(122, 45, 122)
.waterAndFogColor(73, 30, 73)

View file

@ -4,6 +4,8 @@ import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.SurfaceRules;
import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource;
import net.minecraft.world.level.levelgen.placement.CaveSurface;
import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.surface.SurfaceRuleBuilder;
import ru.bclib.api.surface.rules.SwitchRuleSource;
@ -72,11 +74,7 @@ public class SulphurSpringsBiome extends EndBiome.Config {
@Override
public SurfaceRuleBuilder surface() {
return super
.surface()
.rule(2,
SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR,
new SwitchRuleSource(
RuleSource surfaceBlockRule = new SwitchRuleSource(
new SulphuricSurfaceNoiseCondition(),
List.of(
SurfaceRules.state(surfaceMaterial().getAltTopMaterial()),
@ -84,9 +82,11 @@ public class SulphurSpringsBiome extends EndBiome.Config {
SULPHURIC_ROCK,
BRIMSTONE
)
)
)
);
return super
.surface()
.rule(2, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, surfaceBlockRule))
.rule(2, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR), surfaceBlockRule));
}
};
}

View file

@ -15,14 +15,10 @@ public class SulphuricSurfaceNoiseCondition implements NumericProvider {
public int getNumber(SurfaceRulesContextAccessor context) {
final int x = context.getBlockX();
final int z = context.getBlockZ();
final 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
);
final 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);
if (value < -0.6) return 0;
if (value < -0.3) return 1;
if (value < -0.5) return 2;
if (value < 0.5) return 2;
return 3;
}
}