PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Multiple issues with Night Vision Upgrade in Pneumatic Helmet

Vaelzan opened this issue ยท 3 comments

commented

Describe the bug

When the Night Vision Upgrade is installed into a helmet but turned off, this also prevents other sources of the Night Vision effect from working, such as drinking a Night Vision Potion.

Additionally, when the upgrade is turned on it only refreshes when the timer hits zero, causing the screen to pulse / flicker with darkness for about 5-10 seconds before each refresh due to the way the night vision effect wears off. This could probably be fixed by refreshing the buff with 10 seconds to go (or maybe even 15 to account for potential TPS issues on servers?) instead of right at 0.

Expected behavior

Night Vision from other sources should work while the upgrade is disabled - disabling it should really act the same as if the module wasn't installed at all.

Permanent Night Vision effects shouldn't allow the timer of the effect to drop below 10 seconds due to vanilla fading behaviour.

Which Minecraft version are you using?

1.20.1

Which version of PneumaticCraft: Repressurized are you using?

6.0.17

commented

This could probably be fixed by refreshing the buff with 10 seconds to go (or maybe even 15 to account for potential TPS issues on servers?) instead of right at 0.

That's already the case. The buff is refreshed at 11 seconds to go, and I never see the flickering that you report.

if (enabled && hasPressure && (nvInstance == null || nvInstance.getDuration() <= 220)) {
                player.addEffect(new MobEffectInstance(MobEffects.NIGHT_VISION, 500, 0, false, false));

I have a fix for the other issue though (not playing nice with other source of night vision).

commented

I suspect that may have been as a result of low server TPS. I think it was averaging around 10 TPS at the time. I'm not sure why it wouldn't still have refreshed before zero though even with the delay there + significant latency, as it certainly wasn't over eleven seconds of delays. SonoranViking also experienced the same thing.

Edit: Tested it again at 20 TPS and it's fine. I guess my only suggestion then would be that it'd work better on struggling servers if leaving more buffer time - potentially a one minute buff refreshed at the 20 second mark?

commented

I guess I could increase the buffer time, yeah.