|
2 | 2 |
|
3 | 3 | import java.util.Optional; |
4 | 4 |
|
5 | | -import com.google.common.base.Supplier; |
6 | | -import com.google.common.base.Suppliers; |
7 | 5 | import com.mojang.serialization.Codec; |
8 | 6 | import com.mojang.serialization.codecs.RecordCodecBuilder; |
9 | 7 |
|
10 | 8 | import net.fabricmc.api.EnvType; |
11 | 9 | import net.fabricmc.api.Environment; |
12 | 10 | import net.minecraft.client.render.SkyProperties; |
13 | | -import net.minecraft.client.render.SkyProperties.SkyType; |
14 | | -import net.minecraft.util.math.Vec3d; |
15 | 11 |
|
16 | 12 | /** |
17 | 13 | * A Sky effects controller |
@@ -47,21 +43,6 @@ public class StaticSkyEffects extends SkyEffects { |
47 | 43 | private final boolean thickFog; |
48 | 44 | private final float skyShading; |
49 | 45 |
|
50 | | - @Environment(EnvType.CLIENT) |
51 | | - private final Supplier<SkyProperties> memoizedSkyProperties = Suppliers.memoize(() -> new SkyProperties(this.getCloudHeight(), this.hasAlternateSkyColor(), SkyType.valueOf(this.getSkyType()), this.shouldBrightenLighting(), this.isDarkened()) { |
52 | | - |
53 | | - @Override |
54 | | - public Vec3d adjustFogColor(Vec3d color, float sunHeight) { |
55 | | - return color; |
56 | | - } |
57 | | - |
58 | | - @Override |
59 | | - public boolean useThickFog(int camX, int camY) { |
60 | | - return StaticSkyEffects.this.hasThickFog(); |
61 | | - } |
62 | | - |
63 | | - }); |
64 | | - |
65 | 46 | public StaticSkyEffects(Optional<Float> cloudHeight, boolean alternateSkyColor, String skyType, boolean brightenLighting, boolean darkened, boolean thickFog, float skyShading) { |
66 | 47 | this.cloudHeight = cloudHeight; |
67 | 48 | this.alternateSkyColor = alternateSkyColor; |
@@ -102,8 +83,8 @@ public boolean hasThickFog() { |
102 | 83 |
|
103 | 84 | @Override |
104 | 85 | @Environment(EnvType.CLIENT) |
105 | | - public Supplier<SkyProperties> getMemoizedSkyProperties() { |
106 | | - return memoizedSkyProperties; |
| 86 | + public SkyProperties getSkyProperties() { |
| 87 | + return SkyPropertiesCreator.create(getCloudHeight(), hasAlternateSkyColor(), getSkyType(), shouldBrightenLighting(), isDarkened(), hasThickFog()); |
107 | 88 | } |
108 | 89 |
|
109 | 90 | @Override |
|
0 commit comments