FoliaLib icon indicating copy to clipboard operation
FoliaLib copied to clipboard

Implement teleportAsync with TeleportCause

Open xGinko opened this issue 1 year ago • 1 comments

  • teleportAsync can now be used with passing teleportCause
  • PaperImplementation now tests for the existence of Entity#teleportAsync so we can properly use it on Paper as well
  • PaperImplementation now extends FoliaImplementation since Folia's scheduler have been included in regular Paper starting from 1.20 and any other case can fall back to LegacyPaperImplementation

xGinko avatar Jun 23 '24 20:06 xGinko

Hey @xGinko , thanks for the PR. Unfortunately, according to the documentation at ImplementationType.java:14 I chose to consider a platform as "legacy" if they don't support the basic building block of task consumers. Different features that are less essential to schedulers (such as native Folia API support but not really a Folia server) are minor implementation details for the library.

My following solution is possibly not as clean for the library, but I can't reasonably force all Paper servers without Folia's API over to a platform implementation that doesn't support task consumers natively. It would force them to use the hacky workarounds of the LegacySpigotImplementation which are not ideal and only added as a fallback for servers which really refuse to update past 1.13.2...

As such, I propose adding a `` Paper120Implementation (possibly with a better name if you have one) which would take precedence over PaperImplementation if Folia's API is available, possibly testing for one of these classes: image

TechnicallyCoded avatar Jul 03 '24 10:07 TechnicallyCoded