Skip to content

Instantly share code, notes, and snippets.

@isXander
Created April 21, 2023 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isXander/054670738c2fb2c33a4e587e6fcde2d2 to your computer and use it in GitHub Desktop.
Save isXander/054670738c2fb2c33a4e587e6fcde2d2 to your computer and use it in GitHub Desktop.
mixin issue
private void onPress(long window, int button, int action, int modifiers) {
boolean bl;
if (window != this.minecraft.getWindow().getWindow()) {
return;
}
if (this.minecraft.screen != null) {
this.minecraft.setLastInputType(InputType.MOUSE);
}
boolean bl2 = bl = action == 1;
if (Minecraft.ON_OSX && button == 0) {
if (bl) {
if ((modifiers & 2) == 2) {
button = 1;
++this.fakeRightMouse;
}
} else if (this.fakeRightMouse > 0) {
button = 1;
--this.fakeRightMouse;
}
}
// ...
}
}
@BugFix(id = "MC-59810", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, enabled = false, modConflicts = "mcmouser", os = OS.MAC)
@Mixin(MouseHandler.class)
public class MouseHandlerMixin {
@ModifyExpressionValue(method = "onPress", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;ON_OSX:Z", opcode = Opcodes.GETFIELD))
private boolean doRightClickEmulation(boolean isMac) {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment