Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
majijn opened this issue Jun 13, 2019 · 8 comments

Comments

@majijn
Copy link

majijn commented Jun 13, 2019

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.

@Doomgull
Copy link
Collaborator

This still present under 1.10.19?

@majijn
Copy link
Author

majijn commented Jun 13, 2019

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

@yagomont
Copy link

yagomont commented Jun 14, 2019

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.

@Doomgull
Copy link
Collaborator

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.

@HellFirePvP
Copy link
Owner

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.

@majijn
Copy link
Author

majijn commented Aug 4, 2019

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

@Riernar
Copy link

Riernar commented Oct 13, 2019

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 ?

@HellFirePvP
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants