Package devs.beer.nativepackets.api
Class NativePackets
java.lang.Object
devs.beer.nativepackets.api.NativePackets
Process-wide access to the NativePackets runtime owned by the server plugin.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NativePacketsApiapi()Returns the active runtime.static booleanReports whether the runtime is ready for consumers.static voidinstall(NativePacketsApi implementation) Publishes the runtime during plugin enable.static voiduninstall(NativePacketsApi implementation) Clears the runtime during plugin disable when the identical implementation owns it.
-
Method Details
-
api
Returns the active runtime.- Returns:
- active NativePackets API
- Throws:
IllegalStateException- when the plugin is absent or not enabled
-
available
public static boolean available()Reports whether the runtime is ready for consumers.- Returns:
- whether
api()is available
-
install
Publishes the runtime during plugin enable.- Parameters:
implementation- runtime implementation
-
uninstall
Clears the runtime during plugin disable when the identical implementation owns it.- Parameters:
implementation- runtime implementation
-