This commit is contained in:
gamma-delta 2022-05-19 22:18:44 -05:00
parent 804bcecf38
commit 579e110cd6
2 changed files with 9 additions and 2 deletions

View file

@ -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()) }

View file

@ -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();