Andrews54757 / tweakfork

A modified small client-side Minecraft mod that adds various configurable tweaks - plus some more
GNU Lesser General Public License v3.0
80 stars 9 forks source link

mixin target wrong visibility [1.20.1 crash] #56

Closed Pi3tro88 closed 11 months ago

Pi3tro88 commented 11 months ago

crash-2023-10-04_21.43.15-client.txt

image

https://github.com/Andrews54757/tweakfork/blob/fabric_1.20.x/src/main/java/fi/dy/masa/tweakeroo/mixin/MixinWindow.java#L51-L67

fooeyround commented 11 months ago

    @ModifyVariable(method = "onFramebufferSizeChanged", at=@At("HEAD"), ordinal = 1)
    private int tweakfork$offsetWithAspectRatio(int height2) {
        this.yOffset = RenderTweaks.getHeightOffsetWithAspectRatio(this.targetAspectRatio, this.framebufferWidth, height2);
        this.originalFramebufferHeight = height2;
        return height2 - yOffset;
    }

this should work right?

fooeyround commented 11 months ago

    private void onFramebufferSizeChanged(long window, int width, int height) {
        height = this.localvar$zei000$tweakeroo$tweakfork$offsetWithAspectRatio(height);
        if (window == this.handle) {
            int i = this.getFramebufferWidth();
            int j = this.getFramebufferHeight();
            if (width != 0 && height != 0) {
                this.framebufferWidth = width;
                this.framebufferHeight = height;
                if (this.getFramebufferWidth() != i || this.getFramebufferHeight() != j) {
                    this.eventHandler.onResolutionChanged();
                }

            }
        }
    }

    private int localvar$zei000$tweakeroo$tweakfork$offsetWithAspectRatio(int height2) {
        this.yOffset = RenderTweaks.getHeightOffsetWithAspectRatio(this.targetAspectRatio, this.framebufferWidth, height2);
        this.originalFramebufferHeight = height2;
        return height2 - this.yOffset;
    }

mixin out ^