@@ -78,10 +78,18 @@ public void register(@NotNull CustomBiome biome) {
7878 .temperatureAdjustment (settings .modifier ().getModifier ())
7979 .hasPrecipitation (settings .hasPrecipitation ())
8080 .mobSpawnSettings (MobSpawnSettings .EMPTY )
81- .generationSettings (BiomeGenerationSettings .EMPTY )
82- .setAttribute (EnvironmentAttributes .FOG_COLOR , biome .getFogColor ())
83- .setAttribute (EnvironmentAttributes .SKY_COLOR , biome .getSkyColor ())
84- .setAttribute (EnvironmentAttributes .WATER_FOG_COLOR , biome .getWaterColor ());
81+ .generationSettings (BiomeGenerationSettings .EMPTY );
82+
83+ // TODO: Replace with WrappedEnvironmentAttributeMap in the future
84+ if (biome .getFogColor () != -1 ) {
85+ biomeBuilder .setAttribute (EnvironmentAttributes .FOG_COLOR , biome .getFogColor ());
86+ }
87+ if (biome .getSkyColor () != -1 ) {
88+ biomeBuilder .setAttribute (EnvironmentAttributes .SKY_COLOR , biome .getWaterColor ());
89+ }
90+ if (biome .getWaterFogColor () != -1 ) {
91+ biomeBuilder .setAttribute (EnvironmentAttributes .WATER_FOG_COLOR , biome .getWaterFogColor ());
92+ }
8593
8694 // Create a new Biome object with the settings and colors from the CustomBiome object
8795 BiomeSpecialEffects effects = SPECIAL_EFFECTS_HANDLER .build (biome );
@@ -100,8 +108,6 @@ public void register(@NotNull CustomBiome biome) {
100108 Registry .register (registry , resourceLocation , createdBiome );
101109 }
102110
103- System .out .println (createdBiome .getAttributes ());
104-
105111 // Add the custom biome to the list of registered biomes
106112 BiomeHandler .getRegisteredBiomes ().add (biome );
107113 });
@@ -141,12 +147,21 @@ public void modify(@NotNull CustomBiome customBiome) {
141147 List <net .minecraft .world .attribute .AmbientParticle > particles = RENDERER_HANDLER .create (particleRenderer );
142148
143149
144- EnvironmentAttributeMap environmentAttributeMap = EnvironmentAttributeMap .builder ()
145- .set (EnvironmentAttributes .FOG_COLOR , customBiome .getFogColor ())
146- .set (EnvironmentAttributes .SKY_COLOR , customBiome .getSkyColor ())
147- .set (EnvironmentAttributes .WATER_FOG_COLOR , customBiome .getWaterColor ())
148- .set (EnvironmentAttributes .AMBIENT_PARTICLES , particles )
149- .build ();
150+ EnvironmentAttributeMap .Builder environmentAttributeMapBuilder = EnvironmentAttributeMap .builder ()
151+ .set (EnvironmentAttributes .AMBIENT_PARTICLES , particles );
152+
153+ // TODO: Replace with WrappedEnvironmentAttributeMap in the future
154+ if (customBiome .getFogColor () != -1 ) {
155+ environmentAttributeMapBuilder .set (EnvironmentAttributes .FOG_COLOR , customBiome .getFogColor ());
156+ }
157+ if (customBiome .getSkyColor () != -1 ) {
158+ environmentAttributeMapBuilder .set (EnvironmentAttributes .SKY_COLOR , customBiome .getSkyColor ());
159+ }
160+ if (customBiome .getWaterFogColor () != -1 ) {
161+ environmentAttributeMapBuilder .set (EnvironmentAttributes .WATER_FOG_COLOR , customBiome .getWaterFogColor ());
162+ }
163+
164+ EnvironmentAttributeMap environmentAttributeMap = environmentAttributeMapBuilder .build ();
150165
151166 BiomeSpecialEffects specialEffects = SPECIAL_EFFECTS_HANDLER .build (customBiome );
152167
0 commit comments