Interface FlickAPI
- All Known Implementing Classes:
FlickApiImpl
public interface FlickAPI
Entry point of the Flick Server API.
FlickAPI flick = FlickAPI.get();
if (flick.isFlick(player)) {
flick.disableModules(player, List.of(FlickModules.FREELOOK, FlickModules.FULLBRIGHT), "Ranked match");
flick.sendNotification(player, "Match found", "Good luck!");
}
All methods must be called on the server main thread (calls from other threads are re-scheduled onto it).
Methods returning boolean return false when the player is not a Flick player (no handshake),
so they are safe to call for everyone. Everything a server sets lives only for the player's current connection.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classInternal: holder of the running instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddWaypoint(org.bukkit.entity.Player player, FlickWaypoint waypoint) Adds or replaces (same id) a waypoint.booleanclearRichPresence(org.bukkit.entity.Player player) booleanclearWaypoints(org.bukkit.entity.Player player) booleandisableModules(org.bukkit.entity.Player player, Collection<String> moduleIds, String reason) Forces the given Flick modules off for this player (adds to the modules already disabled by this API / config).booleanenableModules(org.bukkit.entity.Player player, Collection<String> moduleIds) Re-allows modules previously disabled through the API (config-disabled modules stay disabled).static FlickAPIget()The running API instance (pluginFlickServerAPImust be enabled — adddepend: [FlickServerAPI]).getClient(org.bukkit.entity.Player player) All online players using Flick.booleanisFlick(org.bukkit.entity.Player player) True once the player's Flick client completed the handshake.booleanremoveWaypoint(org.bukkit.entity.Player player, String waypointId) requestMods(org.bukkit.entity.Player player) Asks the client for its loaded mod ids.booleanreset(org.bukkit.entity.Player player) Clears everything this server set for the player (waypoints, API-disabled modules, presence).booleanresetModules(org.bukkit.entity.Player player) Clears all API-disabled modules (config-disabled modules stay disabled).default booleansendNotification(org.bukkit.entity.Player player, String title, String body) booleansendNotification(org.bukkit.entity.Player player, String title, String body, NotificationKind kind, Duration duration) Glass toast in the top-right corner.booleansetRichPresence(org.bukkit.entity.Player player, String details, String state) Sets the Discord Rich Presence text shown while the player is on this server (details/state ≤ 64 chars each).
-
Method Details
-
get
The running API instance (pluginFlickServerAPImust be enabled — adddepend: [FlickServerAPI]). -
isFlick
boolean isFlick(org.bukkit.entity.Player player) True once the player's Flick client completed the handshake. -
getClient
-
getClients
Collection<FlickPlayer> getClients()All online players using Flick. -
addWaypoint
Adds or replaces (same id) a waypoint. Max 200 per player. -
removeWaypoint
-
clearWaypoints
boolean clearWaypoints(org.bukkit.entity.Player player) -
disableModules
boolean disableModules(org.bukkit.entity.Player player, Collection<String> moduleIds, String reason) Forces the given Flick modules off for this player (adds to the modules already disabled by this API / config). The player sees them greyed out ("Disabled by the server") and cannot enable them until they leave. SeeFlickModulesfor ids; unknown ids are ignored by the client. -
enableModules
Re-allows modules previously disabled through the API (config-disabled modules stay disabled). -
resetModules
boolean resetModules(org.bukkit.entity.Player player) Clears all API-disabled modules (config-disabled modules stay disabled). -
sendNotification
-
sendNotification
boolean sendNotification(org.bukkit.entity.Player player, String title, String body, NotificationKind kind, Duration duration) Glass toast in the top-right corner. Title ≤ 64, body ≤ 160 characters, duration 1–15 s. -
setRichPresence
-
clearRichPresence
boolean clearRichPresence(org.bukkit.entity.Player player) -
requestMods
Asks the client for its loaded mod ids. Completes on the main thread; fails withTimeoutExceptionafter 10 s, orIllegalStateExceptionif the player is not a Flick player / leaves. If the player refused sharing, completes with an empty list. The list is reported by the client and can be spoofed. -
reset
boolean reset(org.bukkit.entity.Player player) Clears everything this server set for the player (waypoints, API-disabled modules, presence).
-