blob: d86985d191f2139333c270868333428053203ad7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
package com.dulkirfabric.mixin;
import com.dulkirfabric.features.InventoryScale;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.minecraft.client.Mouse;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@Mixin(Mouse.class)
public class MouseMixin {
@ModifyExpressionValue(method = "onMouseButton", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledWidth()I"))
public int onMouseButtonWidth(int originalScaledWidth) {
return (int) (originalScaledWidth / InventoryScale.INSTANCE.getScale());
}
@ModifyExpressionValue(method = "onMouseButton", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledHeight()I"))
public int onMouseButtonHeight(int originalScaledHeight) {
return (int) (originalScaledHeight / InventoryScale.INSTANCE.getScale());
}
@ModifyExpressionValue(method = "onCursorPos", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledWidth()I"))
public int onCursorPosWidth(int originalScaledWidth) {
return (int) (originalScaledWidth / InventoryScale.INSTANCE.getScale());
}
@ModifyExpressionValue(method = "onCursorPos", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledHeight()I"))
public int onCursorPosHeight(int originalScaledHeight) {
return (int) (originalScaledHeight / InventoryScale.INSTANCE.getScale());
}
@ModifyExpressionValue(method = "onMouseScroll", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledWidth()I"))
public int onMouseScrollWidth(int originalScaledWidth) {
return (int) (originalScaledWidth / InventoryScale.INSTANCE.getScale());
}
@ModifyExpressionValue(method = "onMouseScroll", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaledHeight()I"))
public int onMouseScrollHeight(int originalScaledHeight) {
return (int) (originalScaledHeight / InventoryScale.INSTANCE.getScale());
}
}
|