Class TeleportProvider
This provider selects the appropriate AbstractTeleporter
implementation
based on the current Minecraft version, handling the evolution of teleportation
systems and NMS player manipulation APIs. Teleporters provide direct NMS-based
teleportation that bypasses Bukkit events for performance-critical operations.
The provider covers major changes in teleportation handling:
- 1.8-1.12: Legacy teleportation with stable NMS player access
- 1.13+: Updated player handling with protocol improvements
- 1.17+: Significant NMS restructuring affecting player manipulation
- 1.20.5+: Mojang-mapped Paper NMS and CraftBukkit implementations
These implementations provide high-performance teleportation that bypasses normal Bukkit event processing, making them suitable for scenarios requiring rapid player movement without triggering standard teleportation events or validation.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull AbstractTeleporter
provide
(int ver) Creates the appropriate implementation for the specified NMS version.
-
Constructor Details
-
TeleportProvider
public TeleportProvider()
-
-
Method Details
-
provide
Creates the appropriate implementation for the specified NMS version.This method must be implemented by subclasses to provide version-specific logic for creating the appropriate implementation. The method receives a formatted NMS integer that can be compared against known version thresholds to determine which implementation to create.
Use the
Provider.f(String)
helper method to convert Minecraft version strings to formatted integers for comparison.Selects the appropriate teleporter implementation based on Minecraft version, accounting for changes in player handling and NMS structure. The selection includes specific handling for the transition to Mojang-mapped implementations.
- Specified by:
provide
in classProvider<AbstractTeleporter>
- Parameters:
ver
- the formatted NMS version integer- Returns:
- the version-appropriate
AbstractTeleporter
implementation - Throws:
IllegalArgumentException
- if the version is below 1.8 (unsupported)
-