Skip to content

Commit 51258e5

Browse files
committed
build: 1.1.11, 1.21.11 support
1 parent 553fb98 commit 51258e5

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.11-SNAPSHOT'
2+
id 'fabric-loom' version '1.13-SNAPSHOT'
33
id 'maven-publish'
44
}
55

@@ -52,6 +52,9 @@ test {
5252

5353
loom {
5454
accessWidenerPath = file("src/main/resources/rsls.accesswidener")
55+
mixin {
56+
useLegacyMixinAp = true
57+
}
5558
}
5659

5760
processResources {

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx2G
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/develop
6-
minecraft_version=1.21.9-rc1
7-
yarn_mappings=1.21.9-rc1+build.1
6+
minecraft_version=1.21.11-rc2
7+
yarn_mappings=1.21.11-rc2+build.1
88
loader_version=0.17.2
99

1010
#Fabric api
11-
fabric_version=0.133.13+1.21.9
11+
fabric_version=0.139.4+1.21.11
1212

1313
# Mod Properties
14-
mod_version = 1.1.10
14+
mod_version = 1.1.11
1515
maven_group = com.ishland
1616
archives_base_name = rsls

src/main/java/com/ishland/fabric/rsls/mixin/MixinMusicTracker.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
77
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
88
import net.minecraft.client.MinecraftClient;
9-
import net.minecraft.client.sound.MusicInstance;
109
import net.minecraft.client.sound.MusicTracker;
1110
import net.minecraft.client.sound.SoundExecutor;
1211
import net.minecraft.client.sound.SoundManager;
@@ -17,6 +16,7 @@
1716
import org.spongepowered.asm.mixin.Shadow;
1817
import org.spongepowered.asm.mixin.Unique;
1918
import org.spongepowered.asm.mixin.injection.At;
19+
import org.spongepowered.asm.mixin.injection.Coerce;
2020
import org.spongepowered.asm.mixin.injection.Inject;
2121
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
2222

@@ -31,16 +31,12 @@ public class MixinMusicTracker {
3131
@Unique
3232
private CompletableFuture<Void> rsls$playFuture;
3333

34-
@Inject(method = "play", at = @At("HEAD"), cancellable = true)
35-
private void prePlay(MusicInstance instance, CallbackInfo ci) {
34+
@WrapMethod(method = "play")
35+
private void wrapPlay(@Coerce Object instance, Operation<Void> original) {
3636
CompletableFuture<Void> rsls$playFuture1 = this.rsls$playFuture;
37-
if (rsls$playFuture1 == null || rsls$playFuture1.isDone()) {
38-
ci.cancel();
37+
if (rsls$playFuture1 != null && !rsls$playFuture1.isDone()) {
38+
return;
3939
}
40-
}
41-
42-
@WrapMethod(method = "play")
43-
private void wrapPlay(MusicInstance instance, Operation<Void> original) {
4440
SoundManager soundManager = this.client.getSoundManager();
4541
SoundSystem soundSystem = ((ISoundManager) soundManager).getSoundSystem();
4642
SoundExecutor taskQueue = ((ISoundSystem) soundSystem).getTaskQueue();

src/main/java/com/ishland/fabric/rsls/mixin/versions/sndmgr/patch_1/MixinSoundManager1_21_9.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import com.ishland.fabric.rsls.common.SoundManagerDuck;
44
import com.ishland.fabric.rsls.mixin.access.ISoundSystem;
5+
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
6+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
57
import net.minecraft.client.sound.SoundManager;
68
import net.minecraft.client.sound.SoundSystem;
79
import net.minecraft.sound.SoundCategory;
@@ -16,19 +18,15 @@
1618
@Mixin(SoundManager.class)
1719
public abstract class MixinSoundManager1_21_9 {
1820

19-
@Shadow
20-
public abstract void updateSoundVolume(SoundCategory category);
21-
2221
@Shadow
2322
@Final
2423
private SoundSystem soundSystem;
2524

2625
@Dynamic
27-
@Inject(method = "updateSoundVolume", at = @At("HEAD"), cancellable = true)
28-
private void onUpdateSoundVolume(SoundCategory category, CallbackInfo ci) {
26+
@WrapMethod(method = {"Lnet/minecraft/class_1144;method_4865(Lnet/minecraft/class_3419;)V", "refreshSoundVolumes"})
27+
private void onUpdateSoundVolume(SoundCategory category, Operation<Void> original) {
2928
if (((SoundManagerDuck) this).rsls$shouldRunOffthread()) {
30-
ci.cancel();
31-
((ISoundSystem) this.soundSystem).getTaskQueue().execute(() -> this.updateSoundVolume(category));
29+
((ISoundSystem) this.soundSystem).getTaskQueue().execute(() -> original.call(category));
3230
}
3331
}
3432

0 commit comments

Comments
 (0)