Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on entering world #142

Open
Phoupraw opened this issue Oct 25, 2024 · 1 comment
Open

Crash on entering world #142

Phoupraw opened this issue Oct 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Phoupraw
Copy link

crash-2024-10-25_22.54.48-client.txt
It seems that mixin captured wrong local.
Here is decomplied mixined class. method_41936 is a lambda in method_2910(attackBlock in yarn).

public boolean method_2910(class_2338 $$0, class_2350 $$1) {
    CallbackInfoReturnable callbackInfo4 = new CallbackInfoReturnable("method_2910", true);
    this.handler$hek000$tweakeroo$handleBreakingRestriction1($$0, $$1, callbackInfo4);
    if (callbackInfo4.isCancelled()) {
        return callbackInfo4.getReturnValueZ();
    } else if (this.field_3712.field_1724.method_21701(this.field_3712.field_1687, $$0, this.field_3719)) {
        return false;
    } else if (!this.field_3712.field_1687.method_8621().method_11952($$0)) {
        return false;
    } else {
        class_1934 var10000 = this.field_3719;
        CallbackInfoReturnable callbackInfo5 = new CallbackInfoReturnable("method_2910", true);
        this.handler$dod000$fabric-events-interaction-v0$attackBlock($$0, $$1, callbackInfo5);
        if (callbackInfo5.isCancelled()) {
            return callbackInfo5.getReturnValueZ();
        } else {
            class_2680 $$3;
            class_638 var10001;
            class_7204 var10002;
            if (var10000.method_8386()) {
                $$3 = this.field_3712.field_1687.method_8320($$0);
                this.field_3712.method_1577().method_4907(this.field_3712.field_1687, $$0, $$3, 1.0F);
                var10001 = this.field_3712.field_1687;
                //method_41936
                var10002 = ($$2) -> {
                    class_636 injectorAllocatedLocal5x = $$0;
                    class_636 injectorAllocatedLocal4 = this;
                    LocalRefImpl ref7 = new LocalRefImpl();
                    LocalRef injectorAllocatedLocal9 = ref7;
                    class_2338 injectorAllocatedLocal8 = injectorAllocatedLocal5x;
                    class_636 injectorAllocatedLocal5 = injectorAllocatedLocal4;
                    injectorAllocatedLocal4 = this;
                    if (this.wrapWithCondition$fld000$porting_lib_entity$wrapBlockLeftClick(injectorAllocatedLocal5, injectorAllocatedLocal8, injectorAllocatedLocal9, $$0, (int)$$1)) {
                        ref7.init($$1);
                        injectorAllocatedLocal4.redirect$hpl000$viafabricplus$checkFireBlock$mixinextras$bridge$133(injectorAllocatedLocal5, injectorAllocatedLocal8, injectorAllocatedLocal9);
                        $$1 = (class_2350)ref7.dispose();
                    } else {
                        boolean var10000 = false;
                    }

                    return new class_2846(class_2847.field_12968, $$0, $$1, $$2);
                };
                CallbackInfoReturnable callbackInfo6 = new CallbackInfoReturnable("method_2910", true);
                this.handler$dfi000$collective$MultiPlayerGameMode_startDestroyBlock_creative($$0, $$1, callbackInfo6);
                if (callbackInfo6.isCancelled()) {
                    return callbackInfo6.getReturnValueZ();
                }

                this.method_41931(var10001, var10002);
                this.field_3716 = this.modifyExpressionValue$ikb000$trifleclient$miningDelay(5);
            } else if (!this.field_3717 || !this.method_2922($$0)) {
                if (this.field_3717) {
                    class_634 var8 = this.field_3720;
                    class_2846 var10 = this.redirect$hpl000$viafabricplus$trackPlayerAction(class_2847.field_12971, this.field_3714, $$1);
                    if (var10 == null) {
                        throw new NullPointerException("@Redirect constructor handler net/minecraft/class_636::trackPlayerAction returned null for net.minecraft.class_2846");
                    }

                    var8.method_52787(var10);
                }

                class_638 var9 = this.field_3712.field_1687;
                this.handler$hek000$tweakeroo$onClickBlockPre($$0, $$1, (CallbackInfoReturnable)null);
                this.handler$fld000$porting_lib_entity$port_lib$startDestroy($$0, $$1, (CallbackInfoReturnable)null);
                $$3 = var9.method_8320($$0);
                this.field_3712.method_1577().method_4907(this.field_3712.field_1687, $$0, $$3, 0.0F);
                var10001 = this.field_3712.field_1687;
                var10002 = ($$3x) -> {
                    boolean $$4 = !$$3.method_26215();
                    if ($$4 && this.field_3715 == 0.0F) {
                        class_1657 injectorAllocatedLocal10 = this.field_3712.field_1724;
                        class_2338 injectorAllocatedLocal9 = $$0;
                        class_1937 injectorAllocatedLocal8 = this.field_3712.field_1687;
                        class_2680 injectorAllocatedLocal7 = $$3;
                        if (this.wrapWithCondition$fld000$porting_lib_entity$cancelLeftClickAttack(injectorAllocatedLocal7, injectorAllocatedLocal8, injectorAllocatedLocal9, injectorAllocatedLocal10)) {
                            injectorAllocatedLocal7.method_26179(injectorAllocatedLocal8, injectorAllocatedLocal9, injectorAllocatedLocal10);
                        }
                    }

                    if ($$4) {
                        class_746 var10001 = this.field_3712.field_1724;
                        class_1937 var10002 = this.field_3712.field_1724.method_37908();
                        CallbackInfoReturnable callbackInfo6 = new CallbackInfoReturnable("method_41930", true);
                        this.handler$fld000$porting_lib_entity$cancelUsePacket($$3, $$0, $$1, $$3x, callbackInfo6);
                        if (callbackInfo6.isCancelled()) {
                            return (class_2596)callbackInfo6.getReturnValue();
                        }

                        if ($$3.method_26165(var10001, var10002, $$0) >= 1.0F) {
                            this.handler$ikb000$trifleclient$miningDelay($$3, $$0, $$1, $$3x, (CallbackInfoReturnable)null);
                            this.method_2899($$0);
                            return new class_2846(class_2847.field_12968, $$0, $$1, $$3x);
                        }
                    }

                    this.field_3717 = true;
                    this.field_3714 = $$0;
                    this.field_3718 = this.field_3712.field_1724.method_6047();
                    this.field_3715 = 0.0F;
                    this.field_3713 = 0.0F;
                    this.field_3712.field_1687.method_8517(this.field_3712.field_1724.method_5628(), this.field_3714, this.method_51888());
                    return new class_2846(class_2847.field_12968, $$0, $$1, $$3x);
                };
                CallbackInfoReturnable callbackInfo7 = new CallbackInfoReturnable("method_2910", true);
                this.handler$dfi000$collective$MultiPlayerGameMode_startDestroyBlock_survival($$0, $$1, callbackInfo7);
                if (callbackInfo7.isCancelled()) {
                    return callbackInfo7.getReturnValueZ();
                }

                this.method_41931(var10001, var10002);
            }

            return true;
        }
    }
}
@Phoupraw
Copy link
Author

I removed ViaFabricPlus and it doesn't crash anymore.

@IThundxr IThundxr added the bug Something isn't working label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants