Package devs.beer.nativepackets.api
Interface NativePacketsApi
public interface NativePacketsApi
Entry point exposed to NativePackets consumers.
-
Method Summary
Modifier and TypeMethodDescriptionconnection(Object platformPlayer) Returns the active connection for a platform player.fast()Returns allocation-minimal semantic packet sends addressed to platform players.Returns the public packet listener registry.packets()Returns the exact-version packet factory.platform()Returns the detected runtime platform.Returns the exact-adapter native text factory.Returns exact-adapter platform utilities.version()Returns the NativePackets implementation version.
-
Method Details
-
version
String version()Returns the NativePackets implementation version.- Returns:
- implementation version
-
platform
PlatformInfo platform()Returns the detected runtime platform.- Returns:
- runtime platform
-
listeners
PacketListenerRegistry listeners()Returns the public packet listener registry.- Returns:
- listener registry
-
connection
Returns the active connection for a platform player.- Parameters:
platformPlayer- platform player owned by this server- Returns:
- cached connection handle
- Throws:
IllegalStateException- when the player connection is not injected
-
fast
FastPacketSender fast()Returns allocation-minimal semantic packet sends addressed to platform players.- Returns:
- stable fast packet sender
-
packets
NativePacketFactory packets()Returns the exact-version packet factory.The factory creates native packets for the active server version. Its returned packet objects are version-coupled and must only be sent through this runtime's
ConnectionHandle.- Returns:
- exact-adapter packet factory
-
utilities
PlatformUtilities utilities()Returns exact-adapter platform utilities.- Returns:
- platform utilities
-
textFactory
NativeTextFactory textFactory()Returns the exact-adapter native text factory.- Returns:
- native text factory
-