Skip to content

Commit

Permalink
Version 1.0.5
Browse files Browse the repository at this point in the history
Fix incompatibility with REI
  • Loading branch information
Siphalor committed Apr 1, 2019
1 parent c6c0462 commit 62012c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=19w13b
yarn_mappings=19w13b.1
yarn_mappings=19w13b.8
loader_version=0.3.7.109

# Mod Properties
mod_id = mousewheelie
mod_version = 1.0.4
mod_version = 1.0.5
maven_group = de.siphalor
archives_base_name = mousewheelie

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ public class MixinMouse {

@Shadow @Final private MinecraftClient client;

@Shadow private double x;

@Shadow private double y;

// Thanks to Danielshe
@Inject(method = "onMouseScroll", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Screen;mouseScrolled(DDD)Z", ordinal = 0), cancellable = true, locals = LocalCapture.CAPTURE_FAILSOFT)
public void onMouseScrolled(long long_1, double double_1, double double_2, CallbackInfo callbackInfo, double scrollAmount, double mouseX, double mouseY) {
public void onMouseScrolled(long windowHandle, double double_1, double scroll, CallbackInfo callbackInfo) {
double mouseX = this.x * (double) this.client.window.getScaledWidth() / (double) this.client.window.getScaleFactor();
double mouseY = this.y * (double) this.client.window.getScaledWidth() / (double) this.client.window.getScaleFactor();
double scrollAmount = scroll * this.client.options.mouseWheelSensitivity;
if(this.client.currentScreen instanceof IContainerScreen) {
if(((IContainerScreen) this.client.currentScreen).mouseWheelie_onMouseScroll(mouseX, mouseY, scrollAmount)) {
callbackInfo.cancel();
Expand Down

0 comments on commit 62012c9

Please sign in to comment.