Cazsius / Spice-of-Life-Carrot-Edition

Motivating people to explore new foods with the carrot, not the stick.
GNU Lesser General Public License v2.1
18 stars 43 forks source link

[Bug] Max Hearts visually set to 10 when changing dimension. #66

Open grundyboy34 opened 5 years ago

grundyboy34 commented 5 years ago

Steps. 1) Config to default 5 max hearts 2) Build nether portal 3) Travel through nether portal 4) Hearts will now show as max of 10 until you relog/restart.

juliand665 commented 5 years ago

Sorry, I was unable to reproduce this locally, neither on the trip to the nether nor back. Which version of the mod are you using? Can you reproduce it with just SoL: Carrot (+ AppleCore) and no other mods?

grundyboy34 commented 5 years ago

I'll try again today. I was running a bit more more mods when this happened such as Tough as Nails, but didn't think any would interact in such a way.

grundyboy34 commented 5 years ago

Okay so this used to happen with StatsKeeper as well until the PlayerChangedDimensionEvent was used to reset visuals. Does this mod use that event? If not, adding it to reset the hearts to the right amount should fix the issue.

juliand665 commented 5 years ago

Hm, that might help, although I really can't know if I can't even reproduce the issue locally, and EntityTravelToDimensionEvent (as it's now called) is actually sent of just before the entity changes dimensions rather than after, so I don't see how it even could help.

My main point, though, is that it works fine in a setup without extra mods, so if it breaks with those other mods around, I'm inclined to say it's on them to fix. For example, they might use an unusual teleportation strategy that results in the other events we're using to not get called—even if we worked around it, other mods wouldn't, so we'd just be endlessly fighting the symptoms rather than addressing the cause.

grundyboy34 commented 5 years ago

It actually seems to be changed to a sub event. PlayerEvent.PlayerChangedDimensionEvent

I'll manually try it later and if it fixes the problem I'll send a pull request or something. Otherwise it sucks that other mods screw it up.

On Tue, Aug 20, 2019, 14:58 Julian Dunskus notifications@github.com wrote:

Hm, that might help, although I really can't know if I can't even reproduce the issue locally, and EntityTravelToDimensionEvent (as it's now called) is actually sent of just before the entity changes dimensions rather than after, so I don't see how it even could help.

My main point, though, is that it works fine in a setup without extra mods, so if it breaks with those other mods around, I'm inclined to say it's on them to fix. For example, they might use an unusual teleportation strategy that results in the other events we're using to not get called—even if we worked around it, other mods wouldn't, so we'd just be endlessly fighting the symptoms rather than addressing the cause.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Cazsius/Spice-of-Life-Carrot-Edition/issues/66?email_source=notifications&email_token=AAHSTRJX2MDMBSXTQIZNEC3QFRLG7A5CNFSM4INN3AY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4XUNJA#issuecomment-523191972, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHSTROAIECNS5AXOUOKPBTQFRLG7ANCNFSM4INN3AYQ .

juliand665 commented 5 years ago

Ah yeah, that does appear to be fired later. It still shouldn't be necessary though; those other mods shouldn't be messing with dimension changes like that…

grundyboy34 commented 5 years ago

I haven't had time to try a code fix, but I did find out more about the behaviour. Going in and out of the Twilight Forest doesn't have this issue, but when going into the nether, and back again seems to make this happen every time. Starting to think that NetherPortalFix may be causing it.

EDIT: Can confirm, disabling NetherPortalFix fixed the issue, so there is definitely an incompatibility there.

juliand665 commented 5 years ago

Interesting; I tried it with just SoL: Carrot, AppleCore, AppleSkin, JEI, HWYLA, and NetherPortalFix, and had no issues. Can you reproduce the issue with just those (or even less)?

grundyboy34 commented 5 years ago

Yes I just did it with SoL: Carrot, AppleCore, and NetherPortalFix Here's what I did. 1) Make a new twitch profile with those 3 mods. 2) Run once. 3) Change SoL: Carrot config to start with 5 hearts. 4) Launch again, start survival world with cheats on. 5) Goto creative mode, make nether portal. 6) Swap back to survival. 7) Go through the portal to the nether. 8) Go back through the portal to the overworld. (Hearts will now show 10 max)

juliand665 commented 5 years ago

Thanks for the detailed steps! I was indeed able to reproduce the issue; I'm really not sure what was wrong earlier because it happens now with the same exact config values… perhaps I wasn't attentive enough. The issue does not seem to occur when you use a portal for the first time; maybe that's why I didn't notice at first.

I still maintain, though, that this is really an issue with NetherPortalFix for changing the way dimension changes work, which is bound to break other mods.

wootaboot commented 4 years ago

It seems that scaling health does not have this problem, maybe what they are doing to increase health doesnt break it.