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 Dec 20, 2022
2 parents 90eeaa9 + ac7ab53 commit b90ba25
Show file tree
Hide file tree
Showing 18 changed files with 936 additions and 938 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.1
yarn_mappings=1.19.3+build.4
loader_version=0.14.11

# Mod Properties
mod_version=0.4.14
mod_version=0.4.15
maven_group=me.flashyreese.mods
archives_base_name=sodium-extra

# Dependencies
reeses_sodium_options=1.4.7+mc1.19.2-build.59
sodium_version=0.4.5+build.206
fabric_version=0.68.1+1.19.3
fabric_version=0.69.1+1.19.3
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 8 additions & 10 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,13 @@ do
esac
done

# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -127,12 +127,14 @@ if [ -n "$JAVA_HOME" ] ; then
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
Expand All @@ -141,16 +143,12 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -239,4 +237,4 @@ eval "set -- $(
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"
exec "$JAVACMD" "$@"
5 changes: 2 additions & 3 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down Expand Up @@ -89,4 +88,4 @@ exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
:omega
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package me.flashyreese.mods.sodiumextra.client;

import me.flashyreese.mods.sodiumextra.client.gui.HudRenderImpl;
import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraGameOptions;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.fabricmc.loader.api.FabricLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -42,5 +44,6 @@ private static SodiumExtraGameOptions loadConfig() {
@Override
public void onInitializeClient() {
getClientTickHandler().onClientInitialize();
HudRenderCallback.EVENT.register(new HudRenderImpl());
}
}
Original file line number Diff line number Diff line change
@@ -1,46 +1,32 @@
package me.flashyreese.mods.sodiumextra.mixin.gui;
package me.flashyreese.mods.sodiumextra.client.gui;

import me.flashyreese.mods.sodiumextra.client.SodiumExtraClientMod;
import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraGameOptions;
import me.flashyreese.mods.sodiumextra.mixin.gui.MinecraftClientAccessor;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.gui.hud.InGameHud;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.minecraft.util.math.Vec3d;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
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.callback.CallbackInfo;

@Mixin(InGameHud.class)
public class MixinInGameHud {
@Shadow
@Final
private MinecraftClient client;

@Shadow
private int scaledWidth;

@Shadow
private int scaledHeight;

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderStatusEffectOverlay(Lnet/minecraft/client/util/math/MatrixStack;)V", shift = At.Shift.BEFORE))
public void render(MatrixStack matrices, float tickDelta, CallbackInfo callbackInfo) {

public class HudRenderImpl implements HudRenderCallback {

private final MinecraftClient client = MinecraftClient.getInstance();

@Override
public void onHudRender(MatrixStack matrixStack, float tickDelta) {
if (!this.client.options.debugEnabled) {
//Gotta love hardcoding
if (SodiumExtraClientMod.options().extraSettings.showFps && SodiumExtraClientMod.options().extraSettings.showCoords) {
this.renderFPS(matrices);
this.renderCoords(matrices);
this.renderFPS(matrixStack);
this.renderCoords(matrixStack);
} else if (SodiumExtraClientMod.options().extraSettings.showFps) {
this.renderFPS(matrices);
this.renderFPS(matrixStack);
} else if (SodiumExtraClientMod.options().extraSettings.showCoords) {
this.renderCoords(matrices);
this.renderCoords(matrixStack);
}
if (!SodiumExtraClientMod.options().renderSettings.lightUpdates) {
this.renderLightUpdatesWarning(matrices);
this.renderLightUpdatesWarning(matrixStack);
}
}
}
Expand All @@ -62,16 +48,16 @@ private void renderFPS(MatrixStack matrices) {
y = 2;
}
case TOP_RIGHT -> {
x = this.scaledWidth - this.client.textRenderer.getWidth(text) - 2;
x = this.client.getWindow().getScaledWidth() - this.client.textRenderer.getWidth(text) - 2;
y = 2;
}
case BOTTOM_LEFT -> {
x = 2;
y = this.scaledHeight - this.client.textRenderer.fontHeight - 2;
y = this.client.getWindow().getScaledHeight() - this.client.textRenderer.fontHeight - 2;
}
case BOTTOM_RIGHT -> {
x = this.scaledWidth - this.client.textRenderer.getWidth(text) - 2;
y = this.scaledHeight - this.client.textRenderer.fontHeight - 2;
x = this.client.getWindow().getScaledWidth() - this.client.textRenderer.getWidth(text) - 2;
y = this.client.getWindow().getScaledHeight() - this.client.textRenderer.fontHeight - 2;
}
default ->
throw new IllegalStateException("Unexpected value: " + SodiumExtraClientMod.options().extraSettings.overlayCorner);
Expand All @@ -94,16 +80,16 @@ private void renderCoords(MatrixStack matrices) {
y = 12;
}
case TOP_RIGHT -> {
x = this.scaledWidth - this.client.textRenderer.getWidth(text) - 2;
x = this.client.getWindow().getScaledWidth() - this.client.textRenderer.getWidth(text) - 2;
y = 12;
}
case BOTTOM_LEFT -> {
x = 2;
y = this.scaledHeight - this.client.textRenderer.fontHeight - 12;
y = this.client.getWindow().getScaledHeight() - this.client.textRenderer.fontHeight - 12;
}
case BOTTOM_RIGHT -> {
x = this.scaledWidth - this.client.textRenderer.getWidth(text) - 2;
y = this.scaledHeight - this.client.textRenderer.fontHeight - 12;
x = this.client.getWindow().getScaledWidth() - this.client.textRenderer.getWidth(text) - 2;
y = this.client.getWindow().getScaledHeight() - this.client.textRenderer.fontHeight - 12;
}
default ->
throw new IllegalStateException("Unexpected value: " + SodiumExtraClientMod.options().extraSettings.overlayCorner);
Expand All @@ -122,16 +108,16 @@ private void renderLightUpdatesWarning(MatrixStack matrices) {
y = 22;
}
case TOP_RIGHT -> {
x = this.scaledWidth - this.client.textRenderer.getWidth(text) - 2;
x = this.client.getWindow().getScaledWidth() - this.client.textRenderer.getWidth(text) - 2;
y = 22;
}
case BOTTOM_LEFT -> {
x = 2;
y = this.scaledHeight - this.client.textRenderer.fontHeight - 22;
y = this.client.getWindow().getScaledHeight() - this.client.textRenderer.fontHeight - 22;
}
case BOTTOM_RIGHT -> {
x = this.scaledWidth - this.client.textRenderer.getWidth(text) - 2;
y = this.scaledHeight - this.client.textRenderer.fontHeight - 22;
x = this.client.getWindow().getScaledWidth() - this.client.textRenderer.getWidth(text) - 2;
y = this.client.getWindow().getScaledHeight() - this.client.textRenderer.fontHeight - 22;
}
default ->
throw new IllegalStateException("Unexpected value: " + SodiumExtraClientMod.options().extraSettings.overlayCorner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import me.jellysquid.mods.sodium.client.gui.options.control.CyclingControl;
import me.jellysquid.mods.sodium.client.gui.options.control.SliderControl;
import me.jellysquid.mods.sodium.client.gui.options.control.TickBoxControl;
import me.jellysquid.mods.sodium.client.gui.options.storage.MinecraftOptionsStorage;
import net.minecraft.client.MinecraftClient;
import net.minecraft.registry.Registries;
import net.minecraft.text.Text;
Expand All @@ -23,6 +24,7 @@

public class SodiumExtraGameOptionPages {
public static final SodiumExtraOptionsStorage sodiumExtraOpts = new SodiumExtraOptionsStorage();
public static final MinecraftOptionsStorage vanillaOpts = new MinecraftOptionsStorage();

private static Text parseVanillaString(String key) {
return Text.literal((Text.translatable(key).getString()).replaceAll("§.", ""));
Expand Down Expand Up @@ -396,6 +398,15 @@ public static OptionPage extra() {
.build()
)
.build());
groups.add(OptionGroup.createBuilder()
.add(OptionImpl.createBuilder(boolean.class, vanillaOpts)
.setName(Text.translatable("sodium-extra.option.advanced_item_tooltips"))
.setTooltip(Text.translatable("sodium-extra.option.advanced_item_tooltips.tooltip"))
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> opts.advancedItemTooltips = value, opts -> opts.advancedItemTooltips)
.build()
)
.build());
groups.add(OptionGroup.createBuilder()
.add(OptionImpl.createBuilder(boolean.class, sodiumExtraOpts)
.setName(Text.translatable("sodium-extra.option.toasts"))
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/sodium-extra/lang/cs_cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"options.particles.minecraft.angry_villager.tooltip": "Attacking a villager in a village; when villagers can't breed because there aren't enough beds nearby or when a panda is attacked by a player on the village.‌",
"options.particles.minecraft.ash": "Popel",
"options.particles.minecraft.ash.tooltip": "Naturally generated in soul sand valley biome environment.",
"options.particles.minecraft.barrier": "Barrier",
"options.particles.minecraft.barrier": "Bariéra",
"options.particles.minecraft.barrier.tooltip": "Barrier block displays when the player holds the Barrier item.",
"options.particles.minecraft.block": "Blok",
"options.particles.minecraft.block.tooltip": "Breaking blocks, sprinting, iron golems walking, armor stands, falling.",
Expand Down Expand Up @@ -95,7 +95,7 @@
"options.particles.minecraft.firework": "Ohňostroj",
"options.particles.minecraft.firework.tooltip": "Firework rocket trail and explosion (trail is not shown when the \"minimal\" particle setting is used), when dolphins track shipwrecks and underwater ruins.",
"options.particles.minecraft.fishing": "Rybolov",
"options.particles.minecraft.fishing.tooltip": "Fishing.",
"options.particles.minecraft.fishing.tooltip": "Rybaření.",
"options.particles.minecraft.flame": "Plamen",
"options.particles.minecraft.flame.tooltip": "Torches, furnaces, magma cubes, spawners.",
"options.particles.minecraft.flash": "Záblesk rachejtle",
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/sodium-extra/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@
"options.particles.minecraft.white_ash.tooltip": "Naturally generated in basalt deltas biome environment.",
"options.particles.minecraft.witch": "Witch",
"options.particles.minecraft.witch.tooltip": "Witch.",
"sodium-extra.option.advanced_item_tooltips": "Advanced Item Tooltips",
"sodium-extra.option.advanced_item_tooltips.tooltip": "If enabled, tooltips for items will display the identifier and durability.",
"sodium-extra.option.advancement_toast": "Advancement Toasts",
"sodium-extra.option.advancement_toast.tooltip": "If enabled, advancement popups will be displayed.",
"sodium-extra.option.animate_fire.tooltip": "If enabled, fire animations are processed.",
Expand Down
Loading

0 comments on commit b90ba25

Please sign in to comment.