Skip to content

Teleports and chunk loads are synchronous on Paper 26.x #6632

Description

@lewisgibson

Type of bug

Performance issue or memory leak, Other unexpected behaviour

/ess dump all output

https://essentialsx.net/dump?bytebin=yrMKjtJY04

Error log (if applicable)

none, nothing is logged.

Bug description

EssentialsX uses PaperLib to teleport players and load chunks asynchronously on Paper. PaperLib 1.0.6 reads the server version from Bukkit#getVersion() with the regex \(MC: (\d)\.(\d+)\.?(\d+?)?(?: Pre-Release )?(\d)?\), which only accepts a single digit major version. On 26.x (... (MC: 26.3)) it does not match, PaperLib sees version 0, and it selects its synchronous handlers for teleportAsync, getChunkAtAsync and getBedSpawnLocationAsync. Every teleport EssentialsX does (/tp, /tpa, /home, /warp, /spawn, /back, /tpr and so on) then calls Entity#teleport, and every chunk it needs is loaded on the main thread.

Steps to reproduce

  1. Run Paper 26.1 or newer with EssentialsX
  2. Run /home or /tpa to a location whose chunk is not loaded
  3. The chunk is loaded on the main thread before the teleport

To see which handlers were selected without teleporting anything, read the asyncTeleportHandler field of the PaperLib environment inside the EssentialsX jar. On 26.3 build 140 it is AsyncTeleportSync.

Expected behaviour

The asynchronous Paper handlers (AsyncTeleportPaper_13, AsyncChunksPaper_15 and BedSpawnLocationPaper) are selected, as they are on 1.21.x.

Actual behaviour

The synchronous handlers are selected.

Additional Information

EssentialsX supports 26.1.2, 26.2 and 26.3, so this applies to all of them. The same wrong version also leaves PaperLib's chunk-generated and bed spawn handlers on their fallbacks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions