Morph passive buff timers (Bug / Request)
Vaygrim opened this issue ยท 16 comments
I don't know if this is a bug, I suspect it is not but it sure SEEMS like it is.
Using the latest version of Metamorph in a 1.10.2 pack, using Forge 2281 (I think that's the right version), your buff timers for stuff like Nightvision (given to Bats) doesn't happen often enough to overlap properly. The result is any player morphing into a bat getting a full screen strobing effect quite regularly (every minute or two?) when the nightvision buff starts to expire.. but then gets its timer topped up again.
This strobing effect is very disconcerting, and I've got several users within my community who are susceptible to seizures, who are having trouble with this particular issue.
Would it be possible for you to just 'lock' the timer for buff passives like this, and only check / remove them once the player changes morphs? Either that, or just refresh the buff slightly more often, so there is enough overlap to prevent that 'expiration' strobe effect?
Thanks for your time.
@mchorse Sorry didn't get an email for your request to check that version you posted. I'll check now, post an update here in a moment if it does resolve it.
v1.1.3 does NOT resolve the issue. You need to refresh the buff more often than once every 2 minutes or so.
@mchorse Any update on this issue?
Sorry for the delay, but after extensive testing I can finally confirm that this version does NOT resolve the problem. The buff starts at 2:00 and is refreshed once every 1:59 , which means there is still about 10 to 15 seconds of flashing screen while the nightvision buff timer is fixing to expire.
If I got another knowledgeable and kind soul that would be willing to make a PR for a fix on this, would you take it?
@Vaygrim really sorry about that :(
Currently I have no time to work on mods or videos, in general, and, to be honest, I made this mod to accompany my Blockbuster mod, but people seem to enjoy it.
Yeah, sure, if it's only a fix for this nightvision problem (or also to fire immune effect (because those abilities share one code)), then I would happily accept it. The code that responsible for that is located in mchorse.metamorph.vanilla_pack.abilities.PotionEffect
.
Whoops, it looks like I haven't pushed the code to the repository. I'll push it ASAP. By the way, the class is mchorse.metamorph.vanilla_pack.abilities.PotionAbility
. I confused the name with vanilla's PotionEffect class.
The problem occurs because PotionAbility just reapplies the effect once the existing version runs out. There are two ways to fix that. You can either chose to re-apply the effect before it actually runs out or instead set the duration of the effect to something absurdly long, such as Integer.MAX_VALUE
@mallrat208 oh, so that's what the flashing he meant about! Dang, I thought @Vaygrim was talking about rapid "flashing" right after the effect is expires and the nightvision flashes. I need to play vanilla minecraft more lol
Honestly... just start up a modded minecraft session with your mod, and transform into a bat at night. Less than 2 minutes (literally) of waiting and you'd see what I was talking about real fast.
@mallrat208, that's what I actually tried to do: b42e870
Ah, the problem is that's checking if the duration is less than 5 ticks/ one quarter of a second. The screen flashing starts at like the last 10 seconds, or 200 ticks, of the effect.
You'd probably want to check to see if you have less than 15 seconds/300 ticks left to trigger the reapply effect so that you're not in danger of triggering the rapid flashing
You may also want to add a null check if you do it that way incase something strips the effect...
Something like ...
if (effect == null || effect.getDuration() < 300)
{
this.onDemorph(target);
this.onMorph(target);
}
@Vaygrim the thing is that I don't play Minecraft at regular basis, I use it for making machinimas, and Metamorph's purpose is to aid my machinima mod to be able to use custom mobs for actors. That's the reason why I'm ignorant of some vanilla things.