Switch to an offset based cloud adjustment for World Providers that adjust it (#1962)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2026-07-25 15:35:40 -07:00
1 parent 3f4995466c
commit 493b641d56
15 files changed
+48 -43

No files matched your search

@@ -490,7 +490,7 @@ public enum Mixins implements IMixins {
"clouds.MixinEntityRenderer",
"clouds.MixinGameSettings",
//"clouds.MixinRenderGlobal",
"clouds.MixinWorldType",
"clouds.MixinWorldProvider",
"fix.MixinRenderItem",
@@ -193,11 +193,6 @@ public class CloudRenderer implements IResourceManagerReloadListener {
scaleMult = cloudScaleMult;
cloudElevation = finiteCloudHeight ? (int) dimCloudHeight : 128;
// Allows the setting to work with RFG and similar without hardcoding.
// The minimum height check is so stuff like Aether cloud height doesn't get messed up.
if (cloudElevation >= 96) {
cloudElevation = (int) Settings.CLOUD_HEIGHT.option.getStore();
}
}
/**
@@ -24,8 +24,11 @@ public class SettingsManager {
new File(Launch.minecraftHome + File.separator + "optionsnf.txt")
);
public static final float VANILLA_CLOUD_HEIGHT = 128.0f;
public static int minimumFarPlaneDistance;
public static double cloudTranslucencyCheck;
public static float cloudHeightOffset;
public static AlwaysNever cloudTranslucencyMode = AlwaysNever.DEFAULT;
public static boolean shadows;
public static boolean droppedItemDetail;
public static boolean leavesOpaque;
@@ -41,19 +44,27 @@ public class SettingsManager {
}
public static void cloudsUpdated() {
cloudHeightOffset = (int)Settings.CLOUD_HEIGHT.option.getStore() - VANILLA_CLOUD_HEIGHT;
if(Settings.MODE_CLOUDS.option.getStore() != GraphicsQualityOff.OFF) {
minimumFarPlaneDistance = 32 * ((int)Settings.RENDER_DISTANCE_CLOUDS.option.getStore());
minimumFarPlaneDistance += (int)Settings.CLOUD_HEIGHT.option.getStore();
mc.gameSettings.clouds = true;
} else {
minimumFarPlaneDistance = 128;
mc.gameSettings.clouds = false;
}
switch((AlwaysNever)Settings.MODE_CLOUD_TRANSLUCENCY.option.getStore()) {
case DEFAULT -> cloudTranslucencyCheck = (int)Settings.CLOUD_HEIGHT.option.getStore();
case ALWAYS -> cloudTranslucencyCheck = Double.NEGATIVE_INFINITY;
case NEVER -> cloudTranslucencyCheck = Double.POSITIVE_INFINITY;
}
cloudTranslucencyMode = (AlwaysNever)Settings.MODE_CLOUD_TRANSLUCENCY.option.getStore();
}
public static float currentCloudHeight() {
return mc.theWorld == null ? VANILLA_CLOUD_HEIGHT : mc.theWorld.provider.getCloudHeight();
}
public static double cloudRenderOrderHeight() {
return switch(cloudTranslucencyMode) {
case ALWAYS -> Double.NEGATIVE_INFINITY;
case NEVER -> Double.POSITIVE_INFINITY;
default -> currentCloudHeight();
};
}
public static void downfallDistanceUpdated() {