Skip to content

Commit 124f998

Browse files
authored
Merge branch '1.21' into copy-spellbook
2 parents ec8552a + 2d316d8 commit 124f998

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricMouseHandlerMixin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package at.petrak.hexcasting.fabric.mixin.client;
22

33
import at.petrak.hexcasting.fabric.event.MouseScrollCallback;
4+
import com.llamalad7.mixinextras.sugar.Local;
45
import net.minecraft.client.MouseHandler;
56
import org.spongepowered.asm.mixin.Mixin;
67
import org.spongepowered.asm.mixin.injection.At;
78
import org.spongepowered.asm.mixin.injection.Inject;
89
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9-
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
1010

1111
@Mixin(MouseHandler.class)
1212
public class FabricMouseHandlerMixin {
13-
@Inject(method = "onScroll", cancellable = true, locals = LocalCapture.CAPTURE_FAILSOFT, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isSpectator()Z"))
14-
private void onScroll(long winptr, double xOff, double yOff, CallbackInfo ci, double delta) {
13+
@Inject(method = "onScroll", cancellable = true, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isSpectator()Z"))
14+
private void onScroll(long winptr, double xOff, double yOff, CallbackInfo ci, @Local(name = "n") int delta) {
1515
var cancel = MouseScrollCallback.EVENT.invoker().interact(delta);
1616
if (cancel) {
1717
ci.cancel();

0 commit comments

Comments
 (0)