diff --git a/gradle.properties b/gradle.properties index 4aa5f43..93b785f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,6 @@ org.gradle.jvmargs=-Xmx1G # Your project's version group=gay.ampflower -projectVersion=0.4.7 +projectVersion=0.4.8 modrinthId=z23qey0b -minecraftCompatible=1.20.6 +minecraftCompatible=1.21 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b6f2ebe..0e8e530 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,14 +2,14 @@ annotations = "23.0.0" # https://github.com/LambdAurora/SpruceUI -spruceui = "5.1.0+1.20.6" -modmenu = "10.0.+" +spruceui = "5.1.0+1.21" +modmenu = "11.0.+" # Minecraft -minecraft_version = "1.20.6" -minecraft_required = "1.20.6" +minecraft_version = "1.21" +minecraft_required = "1.21" fabric_loader = "0.15.+" -fabric_api = "0.100.4+1.20.6" +fabric_api = "0.100.4+1.21" # Plugins loom = "1.+" diff --git a/src/main/java/gay/ampflower/musicmoods/Constants.java b/src/main/java/gay/ampflower/musicmoods/Constants.java index 90b45fa..5273448 100644 --- a/src/main/java/gay/ampflower/musicmoods/Constants.java +++ b/src/main/java/gay/ampflower/musicmoods/Constants.java @@ -35,6 +35,6 @@ public static WidgetSprites widgetHoverable(String widget) { } public static ResourceLocation widget(String widget) { - return new ResourceLocation(modId, "widget/" + widget); + return ResourceLocation.fromNamespaceAndPath(modId, "widget/" + widget); } } diff --git a/src/main/java/gay/ampflower/musicmoods/client/MusicSoundInstance.java b/src/main/java/gay/ampflower/musicmoods/client/MusicSoundInstance.java index 82dc22b..cd17c69 100644 --- a/src/main/java/gay/ampflower/musicmoods/client/MusicSoundInstance.java +++ b/src/main/java/gay/ampflower/musicmoods/client/MusicSoundInstance.java @@ -7,7 +7,7 @@ package gay.ampflower.musicmoods.client;// Created 2023-09-01T02:55:14 import it.unimi.dsi.fastutil.floats.FloatUnaryOperator; -import net.minecraft.client.Timer; +import net.minecraft.client.DeltaTracker; import net.minecraft.client.resources.sounds.AbstractTickableSoundInstance; import net.minecraft.client.resources.sounds.SoundInstance; import net.minecraft.sounds.SoundEvent; @@ -25,7 +25,7 @@ public class MusicSoundInstance extends AbstractTickableSoundInstance { */ private static final float JUMP_LIMIT = 0.025F; - private final Timer timer = new Timer(20F, System.currentTimeMillis(), FloatUnaryOperator.identity()); + private final DeltaTracker.Timer timer = new DeltaTracker.Timer(20F, System.currentTimeMillis(), FloatUnaryOperator.identity()); private float fadeOut; private float fadeIn; @@ -66,10 +66,10 @@ public void setFadeIn(float fadeIn) { @Override public void tick() { - this.timer.advanceTime(System.currentTimeMillis()); + this.timer.advanceTime(System.currentTimeMillis(), false); if (fadeOut > 0F && this.volume > 0F) { - final var newVolume = Math.max(this.volume - Math.min(this.timer.tickDelta / fadeOut, JUMP_LIMIT), 0F); + final var newVolume = Math.max(this.volume - Math.min(this.timer.getRealtimeDeltaTicks() / fadeOut, JUMP_LIMIT), 0F); if (newVolume == newVolume) { this.volume = newVolume; @@ -77,7 +77,7 @@ public void tick() { } if (fadeIn > 0F && this.volume < 1F) { - final var newVolume = Math.min(this.volume + Math.min(this.timer.tickDelta / fadeIn, JUMP_LIMIT), 1F); + final var newVolume = Math.min(this.volume + Math.min(this.timer.getRealtimeDeltaTicks() / fadeIn, JUMP_LIMIT), 1F); if (newVolume == newVolume) { this.volume = newVolume;