Skip to content

Commit

Permalink
Fix missing import on 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
isXander committed Jun 17, 2024
1 parent d335aae commit 22d9682
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build
/.idea
.gradle
!.gitkeep
.kotlin
13 changes: 7 additions & 6 deletions src/main/java/dev/isxander/zoomify/mixins/zoom/MouseMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.client.MouseHandler;
import net.minecraft.util.Mth;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
Expand All @@ -16,23 +17,23 @@
@Mixin(MouseHandler.class)
public class MouseMixin {

/*? if <=1.20.1 {*//*
@Shadow
/*? if <=1.20.1 {*/
/*@Shadow
private double accumulatedScroll;
*//*?}*/

@Inject(
method = "onScroll",
/*? if >1.20.1 {*/
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isSpectator()Z"),
/*?} else {*//*
at = @At(value = "FIELD", target = "Lnet/minecraft/client/MouseHandler;accumulatedScroll:D", ordinal = 7),
/*?} else {*/
/*at = @At(value = "FIELD", target = "Lnet/minecraft/client/MouseHandler;accumulatedScroll:D", ordinal = 7),
*//*?}*/
cancellable = true
)
private void scrollStepCounter(CallbackInfo ci /*? if >1.20.1 {*/, @Local(ordinal = 1) int scrollY /*?}*/) {
/*? if <=1.20.1 {*//*
double scrollY = accumulatedScroll;
/*? if <=1.20.1 {*/
/*double scrollY = accumulatedScroll;
*//*?}*/

if (ZoomifySettings.Companion.getScrollZoom().get()
Expand Down

0 comments on commit 22d9682

Please sign in to comment.