This fixes compatibility issues with libreforge (eco).
I don't see any places where this would cause any problems internally (though I might be wrong).
There is a strange effect when libreforge add_stat effect for the health stat causes the player taking damage non stop, because the effect gets reloaded on every inventory event or even on health regen events.
Libreforge reload looks like this:
call onDisable on the effect -> removes the health modifier which causes here an instant reload which resets the health
call onEnable on the effect -> adds back the modifier which causes here an instant reload which increases the max health via vanilla attribute modifiers.
This libreforge effect reload thing will be called everytime a meaningful inventory event or health regen event or anything like that happens. This makes the add_stat effect unusable with the health stat.
Other possible resolutions from the libreforge side of things:
Make the Effect override shouldReload with false. This is also pretty easy but probably if the amount is an expression that can change, well it won't anymore.
Make effect reloading not dumb. It is already present in the BonusHealth AttributeEffect that removing the reload method and call disable and then enable wasn't the best idea. Reload is a reload for a reason.
I will make this PR a draft. I don't actually want this to be merged since this is very much fixable from the libreforge side and I think it should be fixed there.
In the meantime if anyone really needs a quick fix, build this PR, it will fix the health issue, but use it at your own risk. I haven't tested every internal behavior so it might cause issues. Not likely, but there is always a chance.
This fixes compatibility issues with libreforge (eco). I don't see any places where this would cause any problems internally (though I might be wrong). There is a strange effect when libreforge
add_stat
effect for the health stat causes the player taking damage non stop, because the effect gets reloaded on every inventory event or even on health regen events.Libreforge reload looks like this:
add_stat
effect unusable with the health stat.Other possible resolutions from the libreforge side of things:
shouldReload
withfalse
. This is also pretty easy but probably if the amount is an expression that can change, well it won't anymore.I will make this PR a draft. I don't actually want this to be merged since this is very much fixable from the libreforge side and I think it should be fixed there.
In the meantime if anyone really needs a quick fix, build this PR, it will fix the health issue, but use it at your own risk. I haven't tested every internal behavior so it might cause issues. Not likely, but there is always a chance.