Class FlickApiImpl
java.lang.Object
net.flick.serverapi.internal.FlickApiImpl
- All Implemented Interfaces:
FlickAPI, org.bukkit.event.Listener, org.bukkit.plugin.messaging.PluginMessageListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface FlickAPI
FlickAPI.Holder -
Constructor Summary
Constructors -
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).getClient(org.bukkit.entity.Player player) All online players using Flick.intInbound messages dropped by the rate limit / rejected as malformed (diagnostics).intbooleanisFlick(org.bukkit.entity.Player player) True once the player's Flick client completed the handshake.voidonPluginMessageReceived(String channel, org.bukkit.entity.Player player, byte[] message) voidonQuit(org.bukkit.event.player.PlayerQuitEvent e) voidonWorldChange(org.bukkit.event.player.PlayerChangedWorldEvent e) 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).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).settings()voidshutdown()Called on disable: fail pending futures, forget sessions (clients reset on disconnect anyway).voidApplies a reloaded config to everyone online (module policy).Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FlickAPI
sendNotificationMethods inherited from interface org.bukkit.plugin.messaging.PluginMessageListener
onPluginMessageReceived
-
Constructor Details
-
FlickApiImpl
-
-
Method Details
-
settings
-
inboundDropped
public int inboundDropped()Inbound messages dropped by the rate limit / rejected as malformed (diagnostics). -
inboundRejected
public int inboundRejected() -
updateSettings
Applies a reloaded config to everyone online (module policy). -
onPluginMessageReceived
public void onPluginMessageReceived(String channel, org.bukkit.entity.Player player, byte[] message) - Specified by:
onPluginMessageReceivedin interfaceorg.bukkit.plugin.messaging.PluginMessageListener
-
onQuit
public void onQuit(org.bukkit.event.player.PlayerQuitEvent e) -
onWorldChange
public void onWorldChange(org.bukkit.event.player.PlayerChangedWorldEvent e) -
shutdown
public void shutdown()Called on disable: fail pending futures, forget sessions (clients reset on disconnect anyway). -
isFlick
-
getClient
-
getClients
Description copied from interface:FlickAPIAll online players using Flick.- Specified by:
getClientsin interfaceFlickAPI
-
addWaypoint
Description copied from interface:FlickAPIAdds or replaces (same id) a waypoint. Max 200 per player.- Specified by:
addWaypointin interfaceFlickAPI
-
removeWaypoint
- Specified by:
removeWaypointin interfaceFlickAPI
-
clearWaypoints
public boolean clearWaypoints(org.bukkit.entity.Player player) - Specified by:
clearWaypointsin interfaceFlickAPI
-
disableModules
public boolean disableModules(org.bukkit.entity.Player player, Collection<String> moduleIds, String reason) Description copied from interface:FlickAPIForces 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.- Specified by:
disableModulesin interfaceFlickAPI
-
enableModules
Description copied from interface:FlickAPIRe-allows modules previously disabled through the API (config-disabled modules stay disabled).- Specified by:
enableModulesin interfaceFlickAPI
-
resetModules
public boolean resetModules(org.bukkit.entity.Player player) Description copied from interface:FlickAPIClears all API-disabled modules (config-disabled modules stay disabled).- Specified by:
resetModulesin interfaceFlickAPI
-
sendNotification
public boolean sendNotification(org.bukkit.entity.Player player, String title, String body, NotificationKind kind, Duration duration) Description copied from interface:FlickAPIGlass toast in the top-right corner. Title ≤ 64, body ≤ 160 characters, duration 1–15 s.- Specified by:
sendNotificationin interfaceFlickAPI
-
setRichPresence
Description copied from interface:FlickAPISets the Discord Rich Presence text shown while the player is on this server (details/state ≤ 64 chars each). Only applied if the player shows the server in their Discord status and allows it.- Specified by:
setRichPresencein interfaceFlickAPI
-
clearRichPresence
public boolean clearRichPresence(org.bukkit.entity.Player player) - Specified by:
clearRichPresencein interfaceFlickAPI
-
requestMods
Description copied from interface:FlickAPIAsks 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.- Specified by:
requestModsin interfaceFlickAPI
-
reset
-