Skip to content

Commit

Permalink
Merge branch '1.21/dev' into 1.21/stable
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashyReese committed Sep 15, 2024
2 parents 24ac0ff + b74f584 commit b7627d1
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 81 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ val PARCHMENT_VERSION by extra { null }
// https://semver.org/
val MAVEN_GROUP by extra { "me.flashyreese.mods" }
val ARCHIVE_NAME by extra { "sodium-extra" }
val MOD_VERSION by extra { "0.6.0-beta.2" }
val MOD_VERSION by extra { "0.6.0-beta.3" }
val SODIUM_VERSION by extra { "mc1.21-0.6.0-beta.2" }

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static CaffeineConfig mixinConfig() {
.addMixinOption("render.block", true)
.addMixinOption("render.block.entity", true)
.addMixinOption("render.entity", true)
.addMixinOption("sky", false)
.addMixinOption("sky", true)
.addMixinOption("sky_colors", true)
.addMixinOption("sodium", true)
.addMixinOption("sodium.accessibility", true)
Expand All @@ -69,9 +69,9 @@ public static CaffeineConfig mixinConfig() {
.addMixinOption("sodium.resolution", true)
.addMixinOption("sodium.scrollable_page", true)
.addMixinOption("sodium.vsync", true)
.addMixinOption("stars", false)
.addMixinOption("stars", true)
.addMixinOption("steady_debug_hud", true)
.addMixinOption("sun_moon", false)
.addMixinOption("sun_moon", true)
.addMixinOption("toasts", true)

//.withLogger(SodiumExtraClientMod.logger())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private void renderOptionTooltip(GuiGraphics guiGraphics, ControlElement<?> elem
int textPadding = 3;
int boxPadding = 3;

int boxWidth = 200;
int boxWidth = 240;

int boxY = Math.max(dim.y(), this.dim.y());
int boxX = this.dim.getLimitX() + boxPadding;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package me.flashyreese.mods.sodiumextra.mixin.sky;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexBuffer;
import me.flashyreese.mods.sodiumextra.client.SodiumExtraClientMod;
Expand All @@ -14,17 +16,17 @@

@Mixin(LevelRenderer.class)
public class MixinLevelRenderer {
@Redirect(
@WrapOperation(
method = "renderSky",
at = @At(
value = "INVOKE",
target = "Lcom/mojang/blaze3d/vertex/VertexBuffer;drawWithShader(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/client/renderer/ShaderInstance;)V",
ordinal = 0
)
)
public void redirectSetSkyShader(VertexBuffer instance, Matrix4f viewMatrix, Matrix4f projectionMatrix, ShaderInstance program) {
public void redirectSetSkyShader(VertexBuffer instance, Matrix4f viewMatrix, Matrix4f projectionMatrix, ShaderInstance program, Operation<Void> original) {
if (SodiumExtraClientMod.options().detailSettings.sky) {
instance.drawWithShader(viewMatrix, projectionMatrix, program);
original.call(instance, viewMatrix, projectionMatrix, program);
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private void rebuildGUIOptions(CallbackInfo ci) {
int x = 6;
int y = 28;

OptionPageScrollFrame optionPageScrollFrame = new OptionPageScrollFrame(new Dim2i(x, y, /*this.width - x * 2*/200, this.height - y - 10 /*- 64*/), this.currentPage);
OptionPageScrollFrame optionPageScrollFrame = new OptionPageScrollFrame(new Dim2i(x, y, /*this.width - x * 2*/240, this.height - y - 10 /*- 64*/), this.currentPage);
this.addRenderableWidget(optionPageScrollFrame);
ci.cancel();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.caffeinemc.mods.sodium.client.gui.options.OptionGroup;
import net.caffeinemc.mods.sodium.client.gui.options.OptionImpact;
import net.caffeinemc.mods.sodium.client.gui.options.OptionImpl;
import net.caffeinemc.mods.sodium.client.gui.options.binding.compat.VanillaBooleanOptionBinding;
import net.caffeinemc.mods.sodium.client.gui.options.control.CyclingControl;
import net.caffeinemc.mods.sodium.client.gui.options.storage.MinecraftOptionsStorage;
import net.minecraft.network.chat.Component;
Expand All @@ -22,7 +23,7 @@ public class MixinSodiumGameOptionsPages {
@Final
private static MinecraftOptionsStorage vanillaOpts;

@Redirect(method = "general", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/client/gui/options/OptionGroup$Builder;add(Lnet/caffeinemc/mods/sodium/client/gui/options/Option;)Lnet/caffeinemc/mods/sodium/client/gui/options/OptionGroup$Builder;", ordinal = 5), remap = false)
@Redirect(method = "general", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/client/gui/options/OptionGroup$Builder;add(Lnet/caffeinemc/mods/sodium/client/gui/options/Option;)Lnet/caffeinemc/mods/sodium/client/gui/options/OptionGroup$Builder;", ordinal = 6), remap = false)
private static OptionGroup.Builder redirectVsyncToggle(OptionGroup.Builder instance, Option<?> option) {
if (!option.getTooltip().getString().equals(Component.translatable("sodium.options.v_sync.tooltip").getString())) {
return instance.add(option);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package me.flashyreese.mods.sodiumextra.mixin.stars;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import me.flashyreese.mods.sodiumextra.client.SodiumExtraClientMod;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.LevelRenderer;
Expand All @@ -9,16 +11,16 @@

@Mixin(LevelRenderer.class)
public class MixinLevelRenderer {
@Redirect(
@WrapOperation(
method = "renderSky",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/multiplayer/ClientLevel;getStarBrightness(F)F"
)
)
public float redirectGetStarBrightness(ClientLevel instance, float f) {
public float redirectGetStarBrightness(ClientLevel instance, float f, Operation<Float> original) {
if (SodiumExtraClientMod.options().detailSettings.stars) {
return instance.getStarBrightness(f);
return original.call(instance, f);
} else {
return 0.0f;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package me.flashyreese.mods.sodiumextra.mixin.sun_moon;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import me.flashyreese.mods.sodiumextra.client.SodiumExtraClientMod;
import net.minecraft.client.renderer.DimensionSpecialEffects;
import net.minecraft.client.renderer.LevelRenderer;
Expand All @@ -26,16 +28,16 @@ public class MixinLevelRenderer {
@Final
private static ResourceLocation MOON_LOCATION;

@Redirect(
@WrapOperation(
method = "renderSky",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/DimensionSpecialEffects;getSunriseColor(FF)[F"
)
)
public float[] redirectGetFogColorOverride(DimensionSpecialEffects instance, float skyAngle, float tickDelta) {
public float[] redirectGetFogColorOverride(DimensionSpecialEffects instance, float skyAngle, float tickDelta, Operation<float[]> original) {
if (SodiumExtraClientMod.options().detailSettings.sunMoon) {
return instance.getSunriseColor(skyAngle, tickDelta);
return original.call(instance, skyAngle, tickDelta);
} else {
return null;
}
Expand Down
1 change: 0 additions & 1 deletion common/src/main/resources/sodium-extra.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"sodium.accessibility.MixinSodiumGameOptionPages",
"sodium.cloud.MixinCloudRenderer",
"sodium.fog.MixinOcclusionCuller",
"sodium.resolution.MixinSodiumGameOptionPages",
"sodium.scrollable_page.MixinSodiumOptionsGUI",
"sodium.vsync.MixinSodiumGameOptionsPages",
"stars.MixinLevelRenderer",
Expand Down

0 comments on commit b7627d1

Please sign in to comment.