Skip to content

Commit 81530b9

Browse files
committed
The hotbar scrolling functionality was moved to a new class, so fix mixin accordingly
1 parent 763a3ba commit 81530b9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/in/techpro424/disablehotbarscrolling/mixin/ScrollDisableMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import org.spongepowered.asm.mixin.injection.Inject;
66
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
77

8-
import net.minecraft.entity.player.PlayerInventory;
8+
import net.minecraft.client.Mouse;
99

10-
@Mixin(PlayerInventory.class)
10+
@Mixin(Mouse.class)
1111
public abstract class ScrollDisableMixin {
1212

13-
@Inject(at = @At("HEAD"), method = "Lnet/minecraft/entity/player/PlayerInventory;scrollInHotbar(D)V", cancellable = true)
14-
private void disableScrolling(double scrollAmount, CallbackInfo callbackInfo) {
13+
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerInventory;setSelectedSlot(I)V"), method = "Lnet/minecraft/client/Mouse;onMouseScroll(JDD)V", cancellable = true)
14+
private void disableScrolling(long window, double horizontal, double vertical, CallbackInfo callbackInfo) {
1515
callbackInfo.cancel();
1616
}
1717

0 commit comments

Comments
 (0)