Astral Sorcery

Astral Sorcery

63M Downloads

potioneffectduration perks cause actions which should lower potion duration to lengthen them instead

majijn opened this issue ยท 8 comments

commented

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.

commented

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 ?

commented

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.

commented

This still present under 1.10.19?

commented

yeah this is on 1.10.19
tho im not sure what you mean by "still"

commented

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.

commented

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.

commented

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.

commented

would it be possible for some potion effects to be blacklisted in the config to stop them from being affected by the perk?