TechnicallyCoded / FoliaLib

This is a wrapper library for aiding in supporting the Folia Paper Fork. This library adds multiple scheduler options to use instead of the Bukkit or Folia native schedulers.
MIT License
65 stars 11 forks source link

Method to runAtEntityWithFallback with timer #12

Closed PikaMug closed 6 months ago

PikaMug commented 8 months ago

Would be useful for doing work when entities become dead/retired. For example, when adding a trail of particles behind a projectile. On Spigot/Paper I can just check Projectile#isDead and do some cleanup before manually cancelling the task, but that doesn't seem to happen on Folia; the server just ends the task. Thus, a fallback is necessary.

PikaMug commented 7 months ago

https://jd.papermc.io/folia/1.19/io/papermc/paper/threadedregions/scheduler/EntityScheduler.html#runAtFixedRate(org.bukkit.plugin.Plugin,java.util.function.Consumer,java.lang.Runnable,long,long)

TechnicallyCoded commented 6 months ago

Will be implemented