mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-08 12:35:01 +00:00
Switch to an offset based cloud adjustment for World Providers that adjust it (#1962)
This commit is contained in:
1 parent
3f4995466c
commit
493b641d56
15 files changed
+48
-43
No files matched your search
+1
-1
@@ -90,7 +90,7 @@ dependencies {
|
||||
compileOnly "org.apache.ant:ant:1.8.2"
|
||||
|
||||
// Celeritas (transitive=false: deps provided by GTNHLib/runtime)
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-common:2.5.5-GTNH") { transitive = false }
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-common:2.5.8-GTNH") { transitive = false }
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-lwjgl2-service:2.5.3-GTNH") { transitive = false }
|
||||
|
||||
// Because who doesn't want NEI
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
lwjglVersion = 2.9.4-nightly-20150209
|
||||
eventbusVersion = 7.0-beta.15
|
||||
celeritasVersion = 2.5.3-GTNH
|
||||
celeritasVersion = 2.5.8-GTNH
|
||||
lombokVersion = 1.18.42
|
||||
log4jVersion = 2.0-beta9
|
||||
guavaVersion = 18.0
|
||||
|
||||
+3
-1
@@ -167,7 +167,9 @@ public class PersistentStreamingBuffer implements StreamingBuffer {
|
||||
private boolean syncOldest() {
|
||||
if (fenceQueue.isEmpty()) return false;
|
||||
final FencedRegion region = fenceQueue.first();
|
||||
region.fence.sync();
|
||||
if (!region.fence.sync()) {
|
||||
GLStateManager.LOGGER.warn("Streaming buffer fence wait did not signal; reclaiming {} bytes anyway", region.bytes);
|
||||
}
|
||||
region.fence.delete();
|
||||
fenceQueue.dequeue();
|
||||
remaining += region.bytes;
|
||||
|
||||
@@ -61,7 +61,7 @@ dependencies {
|
||||
api(project(":glsm"))
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:lwjgl3ify:3.0.15:dev") { isTransitive = false }
|
||||
compileOnly("org.embeddedt.celeritas:celeritas-common:2.5.5-GTNH") { isTransitive = false }
|
||||
compileOnly("org.embeddedt.celeritas:celeritas-common:2.5.8-GTNH") { isTransitive = false }
|
||||
|
||||
val osName = System.getProperty("os.name").lowercase()
|
||||
val osArch = System.getProperty("os.arch").lowercase()
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -10,7 +10,6 @@ options.graphics.ultra=Ultra
|
||||
options.off=Aus
|
||||
options.on=An
|
||||
options.cloud_height=Wolkenhöhe
|
||||
options.cloud_height.tooltip=Wolkenhöhe
|
||||
options.cloud_scale=Wolkengröße
|
||||
options.cloud_scale.tooltip=Wolkengröße
|
||||
options.gui_background=Hintergrund
|
||||
|
||||
@@ -11,7 +11,7 @@ options.graphics.ultra=Ultra
|
||||
options.off=Off
|
||||
options.on=On
|
||||
options.cloud_height=Cloud Elevation
|
||||
options.cloud_height.tooltip=Cloud Elevation
|
||||
options.cloud_height.tooltip=Height clouds render at in worlds that do not set their own. Worlds that set one keep it, shifted by this setting's difference from 128.
|
||||
options.cloud_scale=Cloud Scale
|
||||
options.cloud_scale.tooltip=Cloud Scale
|
||||
options.gui_background=Background
|
||||
|
||||
@@ -11,7 +11,6 @@ options.graphics.ultra=ウルトラ
|
||||
options.off=オフ
|
||||
options.on=オン
|
||||
options.cloud_height=雲の高さ
|
||||
options.cloud_height.tooltip=雲の高さを設定します。
|
||||
options.cloud_scale=雲の大きさ
|
||||
options.cloud_scale.tooltip=雲の大きさを設定します。
|
||||
options.gui_background=背景テーマ
|
||||
|
||||
+2
@@ -17,6 +17,8 @@ public abstract class MixinEntityRenderer {
|
||||
float required = SettingsManager.minimumFarPlaneDistance;
|
||||
if (AngelicaConfig.enableVBOClouds) {
|
||||
required = Math.max(required, CloudRenderer.getCloudRenderer().getRequiredFarPlaneDistance());
|
||||
} else {
|
||||
required += SettingsManager.currentCloudHeight();
|
||||
}
|
||||
return Math.max(original, required);
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.clouds;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||
import jss.notfine.core.SettingsManager;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
||||
@Mixin(value = WorldProvider.class)
|
||||
public abstract class MixinWorldProvider {
|
||||
|
||||
@ModifyReturnValue(method = "getCloudHeight", at = @At("RETURN"), remap = false)
|
||||
private float notFine$applyCloudHeightOffset(float original) {
|
||||
return original + SettingsManager.cloudHeightOffset;
|
||||
}
|
||||
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.clouds;
|
||||
|
||||
import jss.notfine.core.Settings;
|
||||
import net.minecraft.world.WorldType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
@Mixin(value = WorldType.class)
|
||||
public abstract class MixinWorldType {
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason Control cloud height.
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public float getCloudHeight() {
|
||||
return (int)Settings.CLOUD_HEIGHT.option.getStore();
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -88,7 +88,7 @@ public abstract class MixinEntityRenderer implements IResourceManagerReloadListe
|
||||
|
||||
@ModifyConstant(method = "renderWorld(FJ)V", constant = @Constant(doubleValue = 128.0D), expect = 2)
|
||||
private double iris$alwaysRenderCloudsLate(double cloudHeightCheck) {
|
||||
return IrisApi.getInstance().isShaderPackInUse() ? Double.NEGATIVE_INFINITY : SettingsManager.cloudTranslucencyCheck;
|
||||
return IrisApi.getInstance().isShaderPackInUse() ? Double.NEGATIVE_INFINITY : SettingsManager.cloudRenderOrderHeight();
|
||||
}
|
||||
|
||||
@Inject(method = "renderWorld(FJ)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;renderSky(F)V"))
|
||||
|
||||
@@ -33,8 +33,8 @@ dependencies {
|
||||
}
|
||||
shadowImplementation("org.antlr:antlr4-runtime:4.13.2")
|
||||
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-common:2.5.5-GTNH) { transitive = false }
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-common:2.5.8-GTNH) { transitive = false }
|
||||
embedOnly("org.embeddedt.celeritas:celeritas-lwjgl2-service:2.5.3-GTNH") { transitive = false }
|
||||
runtimeOnlyNonPublishable("org.embeddedt.celeritas:celeritas-common:2.5.5-GTNH") { transitive = false }
|
||||
runtimeOnlyNonPublishable("org.embeddedt.celeritas:celeritas-common:2.8.5-GTNH") { transitive = false }
|
||||
runtimeOnlyNonPublishable("org.embeddedt.celeritas:celeritas-lwjgl2-service:2.5.3-GTNH") { transitive = false }
|
||||
}
|
||||
Reference in new issue
Block a user