chore: update to 1.21
All checks were successful
ci/woodpecker/push/jfmod Pipeline was successful
ci/woodpecker/tag/jfmod Pipeline was successful

This commit is contained in:
Johannes Frohnmeyer 2024-06-14 10:43:26 +02:00
parent a299df6ef3
commit 4f2c9faf2d
Signed by: Johannes
GPG Key ID: E76429612C2929F4
3 changed files with 33 additions and 6 deletions

View File

@ -10,11 +10,11 @@ allprojects { group = "io.gitlab.jfronny" }
base.archivesName = "slyde"
jfMod {
minecraftVersion = "1.20.5"
minecraftVersion = "1.21"
yarn("build.1")
loaderVersion = "0.15.10"
libJfVersion = "3.15.2"
fabricApiVersion = "0.97.6+1.20.5"
loaderVersion = "0.15.11"
libJfVersion = "3.16.0"
fabricApiVersion = "0.100.1+1.21"
modrinth {
projectId = "slyde"
@ -33,7 +33,7 @@ repositories {
}
dependencies {
modCompileOnly("maven.modrinth:sodium:mc1.20.5-0.5.8")
modCompileOnly("maven.modrinth:sodium:mc1.21-0.5.9")
modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v2")
@ -41,5 +41,5 @@ dependencies {
modLocalRuntime("net.fabricmc.fabric-api:fabric-api")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny")
modLocalRuntime("com.terraformersmc:modmenu:10.0.0-beta.1")
modLocalRuntime("com.terraformersmc:modmenu:11.0.0-beta.1")
}

View File

@ -0,0 +1,26 @@
package io.gitlab.jfronny.slyde.mixin;
import net.minecraft.client.option.SimpleOption;
import net.minecraft.util.math.MathHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(targets = "net.minecraft.client.option.SimpleOption$IntSliderCallbacks")
public interface IntSliderCallbackMixin extends SimpleOption.SliderCallbacks<Integer> {
@Shadow int minInclusive();
@Shadow int maxInclusive();
/**
* @author JFronny
* @reason prevent toValue from limiting us to the upper bound
*/
@Override
@Overwrite
default Integer toValue(double sliderProgress) {
if (sliderProgress >= 1.0 && sliderProgress < 1.00001f) {
sliderProgress = 0.99999f;
}
return MathHelper.floor(MathHelper.map(sliderProgress, 0.0, 1.0, this.minInclusive(), this.maxInclusive() + 1.0));
}
}

View File

@ -8,6 +8,7 @@
"CodecMixin",
"DoubleSliderCallbacksMixin",
"GameOptionsMixin",
"IntSliderCallbackMixin",
"SliderWidgetMixin",
"SodiumSliderControlMixin",
"ValidatingIntSliderCallbacksMixin"