apace100 / apoli

MIT License
40 stars 46 forks source link

[1.20.1] Crash when modifying a PlayerEntityRenderer externally to not render specific model parts #130

Open avetharun opened 1 year ago

avetharun commented 1 year ago

Error logs: (Stripped of debug error messages) https://pastebin.com/qC0LfhiD

The relevant code is here.

External mixin code which causes this:

EntityModel.headParts.forEach(modelPart -> {
    modelPart.visible = !isInvisible;
});
EntityModel.bodyParts.forEach(modelPart -> {
    modelPart.visible = !isInvisible;
});

This issue is incredibly vague, I know, but that's about as much as I can get from the errors and sources.

eggohito commented 1 year ago

Would you be able to send the entire crash report?

avetharun commented 1 year ago

Entire crash report is here: https://pastebin.com/rbgN68er

avetharun commented 1 year ago

Entire crash report is here: https://pastebin.com/rbgN68er

The specific issue that causes this is when rendering the PlayerEntityRenderer's parts as invisible (by setting .visible or .enabled to false)

MerchantPug commented 1 year ago

That shouldn't be it. The crash report is saying that there's an int being casted to a float.

avetharun commented 1 year ago

That's what's happening, and the function being called. This only happens when I try to hide the model via individual parts

eggohito commented 1 year ago

This is quite strange... there doesn't seem to be an obvious issue with how Apoli is modifying the arguments for Model#render called in LivingEntityRenderer#render (the indices used are correct). It also looks correct when exporting the mixin. I've also checked using the debugger, which showed that the mixin modifies the correct variables in the correct indices 🤔

Can you also send the entire external mixin?

avetharun commented 1 year ago

I cannot, since I already used a workaround, but the original code posted is what I used when this issue happened. Sorry