Skip to content

Commit 5e95d98

Browse files
committed
Update to Minecraft 1.21
1 parent e455818 commit 5e95d98

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Your project's version
55
group=gay.ampflower
6-
projectVersion=0.4.7
6+
projectVersion=0.4.8
77
modrinthId=z23qey0b
8-
minecraftCompatible=1.20.6
8+
minecraftCompatible=1.21

gradle/libs.versions.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
annotations = "23.0.0"
33

44
# https://github.com/LambdAurora/SpruceUI
5-
spruceui = "5.1.0+1.20.6"
6-
modmenu = "10.0.+"
5+
spruceui = "5.1.0+1.21"
6+
modmenu = "11.0.+"
77

88
# Minecraft
9-
minecraft_version = "1.20.6"
10-
minecraft_required = "1.20.6"
9+
minecraft_version = "1.21"
10+
minecraft_required = "1.21"
1111
fabric_loader = "0.15.+"
12-
fabric_api = "0.100.4+1.20.6"
12+
fabric_api = "0.100.4+1.21"
1313

1414
# Plugins
1515
loom = "1.+"

src/main/java/gay/ampflower/musicmoods/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public static WidgetSprites widgetHoverable(String widget) {
3535
}
3636

3737
public static ResourceLocation widget(String widget) {
38-
return new ResourceLocation(modId, "widget/" + widget);
38+
return ResourceLocation.fromNamespaceAndPath(modId, "widget/" + widget);
3939
}
4040
}

src/main/java/gay/ampflower/musicmoods/client/MusicSoundInstance.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
package gay.ampflower.musicmoods.client;// Created 2023-09-01T02:55:14
88

99
import it.unimi.dsi.fastutil.floats.FloatUnaryOperator;
10-
import net.minecraft.client.Timer;
10+
import net.minecraft.client.DeltaTracker;
1111
import net.minecraft.client.resources.sounds.AbstractTickableSoundInstance;
1212
import net.minecraft.client.resources.sounds.SoundInstance;
1313
import net.minecraft.sounds.SoundEvent;
@@ -25,7 +25,7 @@ public class MusicSoundInstance extends AbstractTickableSoundInstance {
2525
*/
2626
private static final float JUMP_LIMIT = 0.025F;
2727

28-
private final Timer timer = new Timer(20F, System.currentTimeMillis(), FloatUnaryOperator.identity());
28+
private final DeltaTracker.Timer timer = new DeltaTracker.Timer(20F, System.currentTimeMillis(), FloatUnaryOperator.identity());
2929
private float fadeOut;
3030
private float fadeIn;
3131

@@ -66,18 +66,18 @@ public void setFadeIn(float fadeIn) {
6666

6767
@Override
6868
public void tick() {
69-
this.timer.advanceTime(System.currentTimeMillis());
69+
this.timer.advanceTime(System.currentTimeMillis(), false);
7070

7171
if (fadeOut > 0F && this.volume > 0F) {
72-
final var newVolume = Math.max(this.volume - Math.min(this.timer.tickDelta / fadeOut, JUMP_LIMIT), 0F);
72+
final var newVolume = Math.max(this.volume - Math.min(this.timer.getRealtimeDeltaTicks() / fadeOut, JUMP_LIMIT), 0F);
7373

7474
if (newVolume == newVolume) {
7575
this.volume = newVolume;
7676
}
7777
}
7878

7979
if (fadeIn > 0F && this.volume < 1F) {
80-
final var newVolume = Math.min(this.volume + Math.min(this.timer.tickDelta / fadeIn, JUMP_LIMIT), 1F);
80+
final var newVolume = Math.min(this.volume + Math.min(this.timer.getRealtimeDeltaTicks() / fadeIn, JUMP_LIMIT), 1F);
8181

8282
if (newVolume == newVolume) {
8383
this.volume = newVolume;

0 commit comments

Comments
 (0)