close 75
This commit is contained in:
parent
804bcecf38
commit
579e110cd6
2 changed files with 9 additions and 2 deletions
|
@ -20,7 +20,14 @@ object FabricHexClientInitializer : ClientModInitializer {
|
|||
FabricPacketHandler.initClient()
|
||||
|
||||
WorldRenderEvents.LAST.register { ctx ->
|
||||
// https://www.3dgep.com/understanding-quaternions/
|
||||
val quat = ctx.camera().rotation().copy()
|
||||
quat.mul(-1f) // this should invert it?
|
||||
ctx.matrixStack().pushPose()
|
||||
ctx.matrixStack().mulPose(quat)
|
||||
ctx.matrixStack().scale(-1f, 1f, -1f)
|
||||
HexAdditionalRenderers.overlayLevel(ctx.matrixStack(), ctx.tickDelta())
|
||||
ctx.matrixStack().popPose()
|
||||
}
|
||||
HudRenderCallback.EVENT.register(HexAdditionalRenderers::overlayGui)
|
||||
WorldRenderEvents.START.register { ClientTickCounter.renderTickStart(it.tickDelta()) }
|
||||
|
|
|
@ -10,8 +10,8 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
|||
|
||||
@Mixin(MouseHandler.class)
|
||||
public class FabricMouseHandlerMixin {
|
||||
@Inject(method = "onScroll", cancellable = true, locals = LocalCapture.PRINT, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isSpectator()Z"))
|
||||
private void onScroll(CallbackInfo ci, double delta) {
|
||||
@Inject(method = "onScroll", cancellable = true, locals = LocalCapture.CAPTURE_FAILSOFT, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isSpectator()Z"))
|
||||
private void onScroll(long winptr, double xOff, double yOff, CallbackInfo ci, double delta) {
|
||||
var cancel = MouseScrollCallback.EVENT.invoker().interact(delta);
|
||||
if (cancel) {
|
||||
ci.cancel();
|
||||
|
|
Loading…
Reference in a new issue