Skip to content

Commit 5c20eec

Browse files
committed
[compat] MidnightControls 1.12.1+26.1
1 parent 735e1e2 commit 5c20eec

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ maven_group=dev.stashy
1818
archives_base_name=extrasounds
1919
arrp_version=0.8.1
2020
soundcategories_version=1.2.4+1.19
21-
mn_ctrls_version=1.10.1-fabric
21+
mn_ctrls_version=1.12.1+26.1-fabric
2222
groom_version=1.0.0-SNAPSHOT
2323
gradle_git_rev_version=4.0.0
2424
# Metadata

logics/src/main/java/dev/stashy/extrasounds/logics/compat/mixin/midnightcontrols/InputHandlersMixin.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,28 @@ public abstract class InputHandlersMixin {
1818
@Unique
1919
private static final VersionedHotbarSoundHandler SOUND_HANDLER = ExtraSounds.MANAGER.getHotbarSoundHandler();
2020

21-
@Inject(method = "lambda$handleHotbar$2", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerInventory;setSelectedSlot(I)V", shift = At.Shift.AFTER), require = 0)
21+
@Inject(method = "lambda$handleHotbar$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Inventory;setSelectedSlot(I)V", shift = At.Shift.AFTER), require = 0)
2222
private static void extrasounds$hotbarScroll_integrateMidnightControls(CallbackInfoReturnable<PressAction> cir) {
2323
SOUND_HANDLER.onChange();
2424
}
2525

26+
@Inject(method = "lambda$handleHotbar$2", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerInventory;setSelectedSlot(I)V", shift = At.Shift.AFTER), require = 0)
27+
private static void extrasounds$hotbarScroll_integrateMidnightControls1101(CallbackInfoReturnable<PressAction> cir) {
28+
SOUND_HANDLER.onChange();
29+
}
30+
2631
@Inject(method = "lambda$handleHotbar$2", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerInventory;scrollInHotbar(D)V", shift = At.Shift.AFTER), require = 0)
27-
private static void extrasounds$hotbarScroll_integrateMidnightControls197(CallbackInfoReturnable<PressAction> cir) {
32+
private static void extrasounds$hotbarScroll_integrateMidnightControls1097(CallbackInfoReturnable<PressAction> cir) {
2833
SOUND_HANDLER.onChange();
2934
}
3035

3136
@Inject(method = "lambda$handleHotbar$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerInventory;scrollInHotbar(D)V", shift = At.Shift.AFTER), require = 0)
32-
private static void extrasounds$hotbarScroll_integrateMidnightControls174(CallbackInfoReturnable<PressAction> cir) {
37+
private static void extrasounds$hotbarScroll_integrateMidnightControls1074(CallbackInfoReturnable<PressAction> cir) {
3338
SOUND_HANDLER.onChange();
3439
}
3540

3641
@Inject(method = "lambda$handleHotbar$0", at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/entity/player/PlayerInventory;selectedSlot:I", shift = At.Shift.AFTER), require = 0)
37-
private static void extrasounds$hotbarScroll_integrateMidnightControls150(CallbackInfoReturnable<PressAction> cir) {
42+
private static void extrasounds$hotbarScroll_integrateMidnightControls1050(CallbackInfoReturnable<PressAction> cir) {
3843
SOUND_HANDLER.onChange();
3944
}
4045
}

logics/src/main/java/dev/stashy/extrasounds/logics/compat/mixin/midnightcontrols/MouseMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public abstract class MouseMixin {
2222
* The lambda in 3rd arg of {@code InputUtil#setMouseCallbacks()}
2323
*/
2424
@Unique
25-
private static final String METHOD_SIGN_SETUP_CALLBACK_LAMBDA = "method_22684";
25+
private static final String METHOD_SIGN_ON_BUTTON = "onButton";
2626

27-
@Inject(method = METHOD_SIGN_SETUP_CALLBACK_LAMBDA, at = @At("HEAD"))
27+
@Inject(method = METHOD_SIGN_ON_BUTTON, at = @At("HEAD"))
2828
private void extrasounds$storeHotbarIndex_integrateMidnightControls(CallbackInfo ci) {
2929
final LocalPlayer player = Minecraft.getInstance().player;
3030
if (player == null) {
@@ -33,7 +33,7 @@ public abstract class MouseMixin {
3333
this.currentHotbarSlot = this.soundHandler.getPlayerInventorySlot(player);
3434
}
3535

36-
@Inject(method = METHOD_SIGN_SETUP_CALLBACK_LAMBDA, at = @At("RETURN"))
36+
@Inject(method = METHOD_SIGN_ON_BUTTON, at = @At("RETURN"))
3737
private void extrasounds$touchHotbar_integrateMidnightControls(CallbackInfo ci) {
3838
final LocalPlayer player = Minecraft.getInstance().player;
3939
if (player == null) {

0 commit comments

Comments
 (0)