CameraOverhaul

CameraOverhaul

2M Downloads

Unable to create infinite shaking

slava110 opened this issue ยท 2 comments

commented

Hi. I want to create infinite shaking at specific position. However, when I set lengthInSeconds to 0 or -1, shake doesn't happen. When I set lengthInSeconds to any other value - it works but only for specified amount of time.
I'm using Camera Overhaul 2.0.0-forge+mc.1.19.3-1.20.5 as dependency on 1.20.1.

commented

Floats have a PositiveInfinity value that should work here, but I don't know how you would remove the screenshake instance in that case. I didn't write the related code as an API, and you should be careful using functions not in an API package, which I guess now has a reason to be made. Try-catch everything for the time being.

commented

Hi again. Thanks for answering!
Currently I'm using positive infinity, yeah, but not sure if it will tick out eventually Or it's... The point of infinity lol. That it won't tick out.
To remove it I simply get existing instance and set time to lower value currently. I don't need instant removal, I need a phase before that in my concept (or fade out), so it works for me.
As about API... I don't think Minecraft mods really need an API unless you want to provide stable interface. But usually APIs lacks in functionality. Up to you if you want to provide it c: Maybe it'll be fine in case of a small mod to provide an API