fixes
This commit is contained in:
1 parent
83aea53e57
commit
aa4f6b6ddc
842 files changed
+47284
-91563
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package dev.zprestige.prestige.inject.hooks;
|
||||
|
||||
import dev.zprestige.prestige.ui.mc.Overlay;
|
||||
import net.lenni0451.classtransform.InjectionCallback;
|
||||
import net.lenni0451.classtransform.annotations.CTarget;
|
||||
import net.lenni0451.classtransform.annotations.CTransformer;
|
||||
import net.lenni0451.classtransform.annotations.injection.CInject;
|
||||
import net.minecraft.client.Keyboard;
|
||||
import net.minecraft.client.input.CharInput;
|
||||
import net.minecraft.client.input.KeyInput;
|
||||
|
||||
/** Injection-mode twin of ui.mixin.KeyboardHandlerMixin: swallows keyboard input while the overlay is visible. */
|
||||
@CTransformer({Keyboard.class})
|
||||
public class KeyboardHooks {
|
||||
@CInject(method = {"onKey"}, target = {@CTarget("HEAD")}, cancellable = true)
|
||||
private void key(long window, int action, KeyInput ev, InjectionCallback ci) {
|
||||
if (Overlay.onKey(ev.key(), action)) ci.cancel();
|
||||
}
|
||||
|
||||
@CInject(method = {"onChar"}, target = {@CTarget("HEAD")}, cancellable = true)
|
||||
private void character(long window, CharInput ev, InjectionCallback ci) {
|
||||
if (Overlay.onChar(ev.codepoint())) ci.cancel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.zprestige.prestige.inject.hooks;
|
||||
|
||||
import dev.zprestige.prestige.ui.mc.Overlay;
|
||||
import net.lenni0451.classtransform.InjectionCallback;
|
||||
import net.lenni0451.classtransform.annotations.CTarget;
|
||||
import net.lenni0451.classtransform.annotations.CTransformer;
|
||||
import net.lenni0451.classtransform.annotations.injection.CInject;
|
||||
import net.minecraft.client.Mouse;
|
||||
import net.minecraft.client.input.MouseInput;
|
||||
|
||||
/** Injection-mode twin of ui.mixin.MouseHandlerMixin: swallows mouse input while the overlay is visible. */
|
||||
@CTransformer({Mouse.class})
|
||||
public class MouseHooks {
|
||||
@CInject(method = {"onMouseButton"}, target = {@CTarget("HEAD")}, cancellable = true)
|
||||
private void button(long window, MouseInput info, int action, InjectionCallback ci) {
|
||||
if (Overlay.onMouseButton(info.button(), action)) ci.cancel();
|
||||
}
|
||||
|
||||
@CInject(method = {"onMouseScroll"}, target = {@CTarget("HEAD")}, cancellable = true)
|
||||
private void scroll(long window, double x, double y, InjectionCallback ci) {
|
||||
if (Overlay.onScroll(y)) ci.cancel();
|
||||
}
|
||||
|
||||
@CInject(method = {"onCursorPos"}, target = {@CTarget("HEAD")}, cancellable = true)
|
||||
private void move(long window, double x, double y, InjectionCallback ci) {
|
||||
if (Overlay.onMouseMove()) ci.cancel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package dev.zprestige.prestige.inject.hooks;
|
||||
|
||||
import dev.zprestige.prestige.ui.mc.Overlay;
|
||||
import net.lenni0451.classtransform.InjectionCallback;
|
||||
import net.lenni0451.classtransform.annotations.CTarget;
|
||||
import net.lenni0451.classtransform.annotations.CTransformer;
|
||||
import net.lenni0451.classtransform.annotations.injection.CInject;
|
||||
|
||||
/** Injection-mode twin of ui.mixin.RenderSystemMixin: draws the overlay at the head of RenderSystem.flipFrame (Mojang-named, never remapped). */
|
||||
@CTransformer(name = "com.mojang.blaze3d.systems.RenderSystem")
|
||||
public class RenderSystemHooks {
|
||||
@CInject(method = {"flipFrame"}, target = {@CTarget("HEAD")})
|
||||
private static void overlay(InjectionCallback ci) {
|
||||
Overlay.render();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user