Skip to content

Commit

Permalink
Merge branch '1.19.x/dev' into 1.19.x/stable
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashyReese committed Nov 19, 2022
2 parents 5419306 + 25fe3ae commit 21bd7a0
Show file tree
Hide file tree
Showing 24 changed files with 79 additions and 66 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.14.10

# Mod Properties
mod_version=0.4.12
mod_version=0.4.13
maven_group=me.flashyreese.mods
archives_base_name=sodium-extra

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ protected CaffeineConfig createConfig() {
.addMixinOption("cloud", true)
.addMixinOption("compat", true) // Should not allow users to turn this off
.addMixinOption("fog", true)
.addMixinOption("fog.falloff", true)
.addMixinOption("gui", true)
.addMixinOption("instant_sneak", true)
.addMixinOption("light_updates", true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(BackgroundRenderer.class)
Expand All @@ -25,7 +24,8 @@ public abstract class MixinBackgroundRenderer {
@Inject(method = "applyFog", at = @At(value = "TAIL"))
private static void applyFog(Camera camera, BackgroundRenderer.FogType fogType, float viewDistance, boolean thickFog, float tickDelta, CallbackInfo ci) {
Entity entity = camera.getFocusedEntity();
int fogDistance = SodiumExtraClientMod.options().renderSettings.multiDimensionFogControl ? SodiumExtraClientMod.options().renderSettings.dimensionFogDistanceMap.putIfAbsent(entity.world.getDimension().effects(), 0) : SodiumExtraClientMod.options().renderSettings.fogDistance;
SodiumExtraClientMod.options().renderSettings.dimensionFogDistanceMap.putIfAbsent(entity.world.getDimension().effects(), 0);
int fogDistance = SodiumExtraClientMod.options().renderSettings.multiDimensionFogControl ? SodiumExtraClientMod.options().renderSettings.dimensionFogDistanceMap.get(entity.world.getDimension().effects()) : SodiumExtraClientMod.options().renderSettings.fogDistance;
BackgroundRenderer.StatusEffectFogModifier statusEffectFogModifier = getFogModifier(entity, tickDelta);
if (fogDistance == 0 || statusEffectFogModifier != null) {
return;
Expand All @@ -41,10 +41,4 @@ private static void applyFog(Camera camera, BackgroundRenderer.FogType fogType,
}
}
}

@Redirect(method = "applyFog", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;setShaderFogStart(F)V"))
private static void redirectSetShaderFogStart(float shaderFogStart) {
float fogStart = (float) SodiumExtraClientMod.options().renderSettings.fogStart / 100;
RenderSystem.setShaderFogStart(shaderFogStart * fogStart);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package me.flashyreese.mods.sodiumextra.mixin.fog.falloff;

import com.mojang.blaze3d.systems.RenderSystem;
import me.flashyreese.mods.sodiumextra.client.SodiumExtraClientMod;
import net.minecraft.client.render.BackgroundRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(BackgroundRenderer.class)
public class MixinBackgroundRenderer {
@Redirect(method = "applyFog", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;setShaderFogStart(F)V"))
private static void redirectSetShaderFogStart(float shaderFogStart) {
float fogStart = (float) SodiumExtraClientMod.options().renderSettings.fogStart / 100;
RenderSystem.setShaderFogStart(shaderFogStart * fogStart);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class MixinFireworkParticle {

@Inject(method = "addExplosionParticle", at = @At(value = "HEAD"), cancellable = true)
public void addExplosionParticle(double x, double y, double z, double velocityX, double velocityY, double velocityZ, int[] colors, int[] fadeColors, boolean trail, boolean flicker, CallbackInfo ci) {
if (!SodiumExtraClientMod.options().particleSettings.otherMap.getOrDefault(this.fireworkIdentifier, true)) {
if (!SodiumExtraClientMod.options().particleSettings.otherMap.getOrDefault(this.fireworkIdentifier, true) || !SodiumExtraClientMod.options().particleSettings.particles) {
ci.cancel();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/sodium-extra/lang/cs_cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"sodium-extra.option.tutorial_toast": "Tutorial Toasts",
"sodium-extra.option.tutorial_toast.tooltip": "If enabled, tutorial popups will be displayed.",
"sodium-extra.option.use_adaptive_sync.name": "Adaptivní",
"sodium-extra.option.use_adaptive_sync.tooltip": "Pokud je povoleno, V-Sync bude moci změnit snímek uprostřed vykreslování a vypnout sám sebe, obvykle znatelně pomáhá reagovat.",
"sodium-extra.option.use_adaptive_sync.tooltip": "If enabled, V-Sync will be able to swap mid-frame and disable itself at times, usually notably helping responsiveness. May cause issues with some GPU drivers.",
"sodium-extra.option.use_fast_random": "Použít rychlý náhodný výběr",
"sodium-extra.option.use_fast_random.tooltip": "Při povolení bude pro vykreslování bloků použita rychlá náhodná funkce. Toto může ovlivnit rotaci náhodně otočených textur při porovnání s vanillou.",
"sodium-extra.overlay.coordinates": "X: %s, Y: %s, Z: %s",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/sodium-extra/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"sodium-extra.option.tutorial_toast": "Tutorial Toasts",
"sodium-extra.option.tutorial_toast.tooltip": "If enabled, tutorial popups will be displayed.",
"sodium-extra.option.use_adaptive_sync.name": "Adaptive",
"sodium-extra.option.use_adaptive_sync.tooltip": "Wenn aktiviert, kann V-Sync den mittleren Frame austauschen und sich manchmal selbst deaktivieren. Normalerweise zeigt sich V-Sync erkenntlich bei der Reaktion.",
"sodium-extra.option.use_adaptive_sync.tooltip": "If enabled, V-Sync will be able to swap mid-frame and disable itself at times, usually notably helping responsiveness. May cause issues with some GPU drivers.",
"sodium-extra.option.use_fast_random": "Schnellen Zufallsgenerator verwenden",
"sodium-extra.option.use_fast_random.tooltip": "Falls aktiviert wird eine schnelle Zufallsgeneratorfunktion für das Block-Rendering genutzt. Dies kann die Rotation von einigen zufällig gedrehten Texturen im Vergleich zum Vanilla-Verhalten verändern.",
"sodium-extra.overlay.coordinates": "X: %s, Y: %s, Z: %s",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/sodium-extra/lang/el_gr.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"sodium-extra.option.tutorial_toast": "Tutorial Toasts",
"sodium-extra.option.tutorial_toast.tooltip": "If enabled, tutorial popups will be displayed.",
"sodium-extra.option.use_adaptive_sync.name": "Adaptive",
"sodium-extra.option.use_adaptive_sync.tooltip": "If enabled, V-Sync will be able to swap mid-frame and disable itself at times, usually notably helping responsiveness.",
"sodium-extra.option.use_adaptive_sync.tooltip": "If enabled, V-Sync will be able to swap mid-frame and disable itself at times, usually notably helping responsiveness. May cause issues with some GPU drivers.",
"sodium-extra.option.use_fast_random": "Use Fast Random",
"sodium-extra.option.use_fast_random.tooltip": "If enabled, a fast random function will be used for block rendering. This can affect the rotation of randomly rotated textures when compared to vanilla.",
"sodium-extra.overlay.coordinates": "X: %s, Y: %s, Z: %s",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/sodium-extra/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"sodium-extra.option.tutorial_toast": "Tutorial Toasts",
"sodium-extra.option.tutorial_toast.tooltip": "If enabled, tutorial popups will be displayed.",
"sodium-extra.option.use_adaptive_sync.name": "Adaptive",
"sodium-extra.option.use_adaptive_sync.tooltip": "If enabled, V-Sync will be able to swap mid-frame and disable itself at times, usually notably helping responsiveness.",
"sodium-extra.option.use_adaptive_sync.tooltip": "If enabled, V-Sync will be able to swap mid-frame and disable itself at times, usually notably helping responsiveness. May cause issues with some GPU drivers.",
"sodium-extra.option.use_fast_random": "Use Fast Random",
"sodium-extra.option.use_fast_random.tooltip": "If enabled, a fast random function will be used for block rendering. This can affect the rotation of randomly rotated textures when compared to vanilla.",
"sodium-extra.overlay.coordinates": "X: %s, Y: %s, Z: %s",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/sodium-extra/lang/es_mx.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"sodium-extra.option.tutorial_toast": "Notificación de tutorial",
"sodium-extra.option.tutorial_toast.tooltip": "Si está habilitado, se mostrarán ventanas emergentes de tutorial.",
"sodium-extra.option.use_adaptive_sync.name": "Adaptivo",
"sodium-extra.option.use_adaptive_sync.tooltip": "Si está habilitado, V-Sync podrá cambiar la fotograma media y deshabilitarse a sí mismo a veces, lo que generalmente ayuda notablemente a la tiempo de respuesta.",
"sodium-extra.option.use_adaptive_sync.tooltip": "If enabled, V-Sync will be able to swap mid-frame and disable itself at times, usually notably helping responsiveness. May cause issues with some GPU drivers.",
"sodium-extra.option.use_fast_random": "Utilice aleatorio rápido",
"sodium-extra.option.use_fast_random.tooltip": "Si está habilitada, se utilizará una función aleatoria rápida para la representación de bloques. Esto puede afectar la rotación de texturas rotadas aleatoriamente en comparación con vainilla.",
"sodium-extra.overlay.coordinates": "X: %s, Y: %s, Z: %s",
Expand Down
Loading

0 comments on commit 21bd7a0

Please sign in to comment.