Foliage color
This commit is contained in:
parent
f7b2982145
commit
af6359f98c
5 changed files with 32 additions and 12 deletions
|
@ -15,6 +15,7 @@ public class BiomeChorusForest extends EndBiome {
|
|||
super(new BiomeDefinition("chorus_forest")
|
||||
.setFogColor(87, 26, 87)
|
||||
.setFogDensity(1.5F)
|
||||
.setPlantsColor(122, 45, 122)
|
||||
.setSurface(BlockRegistry.CHORUS_NYLIUM)
|
||||
.setParticles(ParticleTypes.PORTAL, 0.01F)
|
||||
.setLoop(SoundRegistry.AMBIENT_CHORUS_FOREST)
|
||||
|
|
|
@ -8,6 +8,7 @@ import ru.betterend.registry.StructureRegistry;
|
|||
public class BiomeCrystalMountains extends EndBiome {
|
||||
public BiomeCrystalMountains() {
|
||||
super(new BiomeDefinition("crystal_mountains")
|
||||
.setPlantsColor(255, 133, 211)
|
||||
.setMusic(SoundRegistry.MUSIC_CRYSTAL_MOUNTAINS)
|
||||
.addStructureFeature(StructureRegistry.MOUNTAIN)
|
||||
.addFeature(FeatureRegistry.ROUND_CAVE)
|
||||
|
|
|
@ -37,6 +37,8 @@ import ru.betterend.world.structures.EndStructureFeature;
|
|||
import ru.betterend.world.surface.DoubleBlockSurfaceBuilder;
|
||||
|
||||
public class BiomeDefinition {
|
||||
private static final int DEF_FOLIAGE = MHelper.color(197, 210, 112);
|
||||
|
||||
private final List<ConfiguredStructureFeature<?, ?>> structures = Lists.newArrayList();
|
||||
private final List<FeatureInfo> features = Lists.newArrayList();
|
||||
private final List<SpawnInfo> mobs = Lists.newArrayList();
|
||||
|
@ -50,6 +52,8 @@ public class BiomeDefinition {
|
|||
private int waterFogColor = 329011;
|
||||
private int waterColor = 4159204;
|
||||
private int fogColor = 10518688;
|
||||
private int foliageColor = DEF_FOLIAGE;
|
||||
private int grassColor = DEF_FOLIAGE;
|
||||
private float fogDensity = 1F;
|
||||
|
||||
private final Identifier id;
|
||||
|
@ -128,12 +132,16 @@ public class BiomeDefinition {
|
|||
features.add(info);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setFogColor(int r, int g, int b) {
|
||||
|
||||
private int getColor(int r, int g, int b) {
|
||||
r = MathHelper.clamp(r, 0, 255);
|
||||
g = MathHelper.clamp(g, 0, 255);
|
||||
b = MathHelper.clamp(b, 0, 255);
|
||||
this.fogColor = MHelper.color(r, g, b);
|
||||
return MHelper.color(r, g, b);
|
||||
}
|
||||
|
||||
public BiomeDefinition setFogColor(int r, int g, int b) {
|
||||
this.fogColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -143,20 +151,28 @@ public class BiomeDefinition {
|
|||
}
|
||||
|
||||
public BiomeDefinition setWaterColor(int r, int g, int b) {
|
||||
r = MathHelper.clamp(r, 0, 255);
|
||||
g = MathHelper.clamp(g, 0, 255);
|
||||
b = MathHelper.clamp(b, 0, 255);
|
||||
this.waterColor = MHelper.color(r, g, b);
|
||||
this.waterColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setWaterFogColor(int r, int g, int b) {
|
||||
r = MathHelper.clamp(r, 0, 255);
|
||||
g = MathHelper.clamp(g, 0, 255);
|
||||
b = MathHelper.clamp(b, 0, 255);
|
||||
this.waterFogColor = MHelper.color(r, g, b);
|
||||
this.waterFogColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setFoliageColor(int r, int g, int b) {
|
||||
this.foliageColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setGrassColor(int r, int g, int b) {
|
||||
this.grassColor = getColor(r, g, b);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setPlantsColor(int r, int g, int b) {
|
||||
return this.setFoliageColor(r, g, b).setGrassColor(r, g, b);
|
||||
}
|
||||
|
||||
public BiomeDefinition setLoop(SoundEvent loop) {
|
||||
this.loop = loop;
|
||||
|
@ -191,7 +207,7 @@ public class BiomeDefinition {
|
|||
structures.forEach((structure) -> generationSettings.structureFeature(structure));
|
||||
features.forEach((info) -> generationSettings.feature(info.featureStep, info.feature));
|
||||
|
||||
effects.skyColor(0).waterColor(waterColor).waterFogColor(waterFogColor).fogColor(fogColor);
|
||||
effects.skyColor(0).waterColor(waterColor).waterFogColor(waterFogColor).fogColor(fogColor).foliageColor(foliageColor).grassColor(grassColor);
|
||||
if (loop != null) effects.loopSound(loop);
|
||||
if (mood != null) effects.moodSound(mood);
|
||||
if (additions != null) effects.additionsSound(additions);
|
||||
|
|
|
@ -12,6 +12,7 @@ import ru.betterend.registry.StructureRegistry;
|
|||
public class BiomeFoggyMushroomland extends EndBiome {
|
||||
public BiomeFoggyMushroomland() {
|
||||
super(new BiomeDefinition("foggy_mushroomland")
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.setFogColor(41, 122, 173)
|
||||
.setFogDensity(3)
|
||||
.setWaterColor(119, 227, 250)
|
||||
|
|
|
@ -11,6 +11,7 @@ import ru.betterend.registry.StructureRegistry;
|
|||
public class BiomeMegalake extends EndBiome {
|
||||
public BiomeMegalake() {
|
||||
super(new BiomeDefinition("megalake")
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.setFogColor(178, 209, 248)
|
||||
.setWaterColor(96, 163, 255)
|
||||
.setWaterFogColor(96, 163, 255)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue