potioneffectduration perks cause actions which should lower potion duration to lengthen them instead
majijn opened this issue ยท 8 comments
main example is rustic's inebriation potion effect, which starts usually at 8~ minutes, and doesnt do anything unless its level 3 (which happens when you drink too much alcohol)
however, if you drink water bottles, it's supposed to shorten the duration (even clearing it completely if it goes low enough), with potioneffectduration perks this causes lengthening instead.
Hi @Doomgull @HellFirePvP ,
If Rustic used net.minecraft.entity.EntityLivingBase.getActivePotionMap()
to get the potion map and replace the PotionEffect
mapped to rustic:tipsy
by a new PotionEffect
with modified duration, without calling EntityLivingBase.addPotionEffect()
, would that fix the issue ?
Ignoring the perk effects for perks that have a negative effect as defined in code.
So if you are affected by poison or wither, the perks would no longer extend their duration.
There was an issue about a similar problem earlier, and the problem was fixed. I think doomgull just misworded it. (You made it)
I think this counts as a mod interaction though, since vanilla doesn't usually reduce effect durations- only erasing them with milk.
Basically. Haven't had a chance to look yet, but this WAS fixed in general, and is likely an interaction with how rustic does the reduction.
I'm not sure this can be fixed.
Responsible code on rustic's end:
https://github.com/the-realest-stu/Rustic/blob/master/src/main/java/rustic/common/potions/EventHandlerPotions.java#L36-L39
Which is done because minecraft doesn't allow to "reduce" duration on an existing potion, just by removing and re-adding that potioneffect. It only allows for adding additional duration:
https://i.imgur.com/HBeHnIA.png
So there's not much else to do on rustic's side, and the potion effect duration perks extend newly applied potion effects, so... if that additional duration is more than what the rusic reduction removes, i'm not sure i can fix this as i cannot discern if the newly added potion effect was something that was "just" removed.