Minigeee / life-crystals

MIT License
1 stars 1 forks source link

1.20.1 issues #5

Open viktordimov opened 6 months ago

viktordimov commented 6 months ago

Fabric 0.15.7 Minecraft 1.20.1

Consuming a life crystal changes HP to 1 single heart, not updating until player dies. Not exactly sure how to replicate the issue - will test without other mods.

viktordimov commented 6 months ago

Only Life Crystals and Fabric API installed

With other mods

Can't identify what is causing the issue since there is nothing on the log after giving myself 6 shards, crafting a heart and consuming it. The HP resets to the correct amount after death.

[03:46:46] [Server thread/INFO]: [OneWildViktor: Gave 6 [Life Crystal Shard] to OneWildViktor]
[03:46:46] [Render thread/INFO]: [CHAT] Gave 6 [Life Crystal Shard] to OneWildViktor
[03:47:11] [Render thread/INFO]: Loaded entity minecraft:dolphin
[03:47:14] [Render thread/INFO]: Loaded entity minecraft:enderman
[03:47:16] [Render thread/WARN]: [EMF]: Entity model [net.minecraft.class_612] has been overridden by [net.minecraft.class_615] likely from a mod.
[03:47:16] [Render thread/WARN]: [EMF]: Prevent model overrides option is enabled! EMF will attempt to revert the new model [net.minecraft.class_615] back into the original model [net.minecraft.class_612]. THIS MAY HAVE UNINTENDED EFFECTS ON THE OTHER MOD, DISABLE THIS EMF SETTING IF IT CAUSES CRASHES!
[03:47:29] [Server thread/INFO]: OneWildViktor fell from a high place
[03:47:29] [Render thread/INFO]: [CHAT] OneWildViktor fell from a high place

This happens on that particular world. It doesn't seem to happen on new ones.

Minigeee commented 6 months ago

I accidentally used == rather than .equals() to compare strings in the part of the code that removes previous attribute modifiers. I think the reason the health goes down to 1 is because the health modifiers stack up (negative values if the base health is less than 20) without being removed correctly because I didn't compare the strings correctly. I think this is the problem, but I am not completely sure.

I will fix and upload tomorrow. Sorry for the bug, haven't used Java in a while and forgot reference comparisons were a thing :P

Minigeee commented 6 months ago

I uploaded the potential fix for versions 1.20.1-1.20.3, 1.20.4 should not have the same bug. lmk if the bug continues to happen

viktordimov commented 6 months ago

As soon as I can, I'll test it. Thank you!