1
0
forked from Clones/Controlify

fix events

This commit is contained in:
isXander
2023-03-12 11:14:42 +00:00
parent eeef512fe2
commit e1462a4f6b
4 changed files with 6 additions and 6 deletions

View File

@ -5,5 +5,5 @@ modName=Controlify
modDescription=Another controller mod - for fabric!
curseforgeId=
modrinthId=
modrinthId=DOUdJVEm
githubProject=isXander/Controlify

View File

@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
@Mixin(BaseOptionElementWidget.class)
@Mixin(value = BaseOptionElementWidget.class, remap = false)
public abstract class BaseOptionElementWidgetMixin implements ComponentProcessorProvider {
@Shadow public abstract boolean applyPreviousValue();
@Shadow public abstract boolean applyNextValue();

View File

@ -16,7 +16,7 @@ public class KeyboardHandlerMixin {
@Shadow @Final private Minecraft minecraft;
// m_unngxkoe is lambda for GLFW keypress hook - do it outside of the `keyPress` method due to fake inputs
@Inject(method = "m_unngxkoe", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/KeyboardHandler;keyPress(JIIII)V"))
@Inject(method = "method_22678", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/KeyboardHandler;keyPress(JIIII)V"))
private void onKeyboardInput(long window, int i, int j, int k, int m, CallbackInfo ci) {
if (window == minecraft.getWindow().getWindow())
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);

View File

@ -16,21 +16,21 @@ public class MouseHandlerMixin {
@Shadow @Final private Minecraft minecraft;
// m_sljgmtqm is lambda for GLFW mouse click hook - do it outside of the `onPress` method due to fake inputs
@Inject(method = "m_sljgmtqm", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onPress(JIII)V"))
@Inject(method = "method_22686", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onPress(JIII)V"))
private void onMouseClickInput(long window, int button, int action, int modifiers, CallbackInfo ci) {
if (window == minecraft.getWindow().getWindow())
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
}
// m_swhlgdws is lambda for GLFW mouse move hook - do it outside of the `onMove` method due to fake inputs
@Inject(method = "m_swhlgdws", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onMove(JDD)V"))
@Inject(method = "method_22689", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onMove(JDD)V"))
private void onMouseMoveInput(long window, double x, double y, CallbackInfo ci) {
if (window == minecraft.getWindow().getWindow())
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
}
// m_qoshpwkl is lambda for GLFW mouse scroll hook - do it outside of the `onScroll` method due to fake inputs
@Inject(method = "m_qoshpwkl", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onScroll(JDD)V"))
@Inject(method = "method_22687", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onScroll(JDD)V"))
private void onMouseScrollInput(long window, double scrollDeltaX, double scrollDeltaY, CallbackInfo ci) {
if (window == minecraft.getWindow().getWindow())
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);