ichttt / FirstAid

A Minecraft Mod that changes the vanilla health system
GNU General Public License v3.0
27 stars 28 forks source link

Prevent player is missing a damage model crash #210

Closed DUDEbehindDUDE closed 1 week ago

DUDEbehindDUDE commented 11 months ago

This pr should the player is missing a damage model crash if you heal the same tick that you died. This can be easily replicated if you have regeneration, are at full health, but take enough damage to your head or body that it instantly kills you. (I have a mod installed that does makes campfires give you regeneration, so this was very easy for me to find). As a note, I don't think this fixes the NBT issue that I have seen (and I don't know how to replicate that).

TqLxQuanZ commented 11 months ago

This is a great fix! @ichttt Are there any plans for merging this soon?

Untrustedlife commented 2 weeks ago

If ichitt doenst merge this im just forking their mod myself and redistributing it with the fix as this isue make sthe game unplayable.

Untrustedlife commented 2 weeks ago

I’ve successfully fixed the bug and compiled the JAR file. I’ll be uploading it to CurseForge after testing it myself. Honestly it was super easy barely an inconveniance thanks to the gradle build file already in the repo.

Since the mod is under the GPL license, there should be no issue with me uploading it. @ichttt, I’ve only fixed it for version 1.19.2 because that’s what my modpack uses. I plan to explore more and see what else I can learn about modding Minecraft.

By the way, I’ve already made a mod that has 59k downloads, so this should be fun!

Untrustedlife commented 2 weeks ago

Okay! After testing, this fix alone didn't fix the bug, the function on line 145 also needs to be updated. I did this on my fork. I also fixed another issue. https://github.com/Untrustedlife/FirstAidCrashFix That is probably why this fix was never merged. After updating both line 145 and this, i finally can play without crashes

ichttt commented 1 week ago

I'm so sorry this took ages for me to acknowledge, at the time I wanted to reproduce it locally, but I did not have the time to look into it and then lost track of it. I still did not reproduce it, but looking at the latest stack traces, this fix seems correct, so I'll just merge it. Thanks!

Untrustedlife commented 13 hours ago

I'm so sorry this took ages for me to acknowledge, at the time I wanted to reproduce it locally, but I did not have the time to look into it and then lost track of it. I still did not reproduce it, but looking at the latest stack traces, this fix seems correct, so I'll just merge it. Thanks!

A reliable method was to inflict significant self-damage, apply some bandages, and then drown yourself. I was consistently crashing when I did that.