Class Floodgate
Handles detection and interaction with Bedrock players connecting via Geyser and Floodgate on Java servers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.geysermc.floodgate.api.FloodgateApi
Reference to the Floodgate API.private final Graves
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCorrectUniqueId
(UUID uuid) Gets the Java-corrected unique UUID for the given UUID.getCorrectUniqueId
(org.bukkit.entity.Player player) Retrieves the normalized (Java-style) UUID for a given player.getCorrectUsername
(org.bukkit.entity.Player player) Deprecated.Use UUIDs for any identity-related logic.getNormalizedUUID
(org.bukkit.entity.Player player) Gets a normalized UUID for comparison across Java and Bedrock players.org.geysermc.floodgate.api.player.FloodgatePlayer
Retrieves the Floodgate player instance for the given UUID.org.geysermc.floodgate.api.player.FloodgatePlayer
getPlayer
(org.bukkit.entity.Player player) Retrieves the Floodgate player instance for the given player.boolean
isBedrockPlayer
(org.bukkit.entity.Player player) Checks if the given player is a Bedrock (Floodgate) player.boolean
isFloodgateId
(UUID uuid) Checks if the given UUID is a Floodgate-specific ID.boolean
isFloodgateId
(org.bukkit.entity.Player player) Checks if the given player is identified by a Floodgate-specific UUID.
-
Field Details
-
plugin
-
floodgateApi
private final org.geysermc.floodgate.api.FloodgateApi floodgateApiReference to the Floodgate API.
-
-
Constructor Details
-
Floodgate
-
-
Method Details
-
isBedrockPlayer
public boolean isBedrockPlayer(org.bukkit.entity.Player player) Checks if the given player is a Bedrock (Floodgate) player.- Parameters:
player
- the player to check- Returns:
- true if the player is a Bedrock client, false otherwise
-
isFloodgateId
public boolean isFloodgateId(org.bukkit.entity.Player player) Checks if the given player is identified by a Floodgate-specific UUID.- Parameters:
player
- the player to check- Returns:
- true if the player's UUID is a Floodgate ID, false otherwise
-
isFloodgateId
Checks if the given UUID is a Floodgate-specific ID.- Parameters:
uuid
- the UUID to check- Returns:
- true if the UUID belongs to a Bedrock player, false otherwise
-
getPlayer
public org.geysermc.floodgate.api.player.FloodgatePlayer getPlayer(org.bukkit.entity.Player player) Retrieves the Floodgate player instance for the given player.- Parameters:
player
- the Bukkit player- Returns:
- the Floodgate player instance, or null if not a Bedrock player
-
getPlayer
Retrieves the Floodgate player instance for the given UUID.- Parameters:
uuid
- the UUID of the player- Returns:
- the Floodgate player instance, or null if not found
-
getNormalizedUUID
Gets a normalized UUID for comparison across Java and Bedrock players.If the player is a Bedrock client, this returns the Java-style UUID Floodgate maps them to. Otherwise, returns their Bukkit UUID.
- Parameters:
player
- the player- Returns:
- a UUID that can be used for consistent ownership checks
-
getCorrectUsername
Deprecated.Use UUIDs for any identity-related logic. This method should only be used for display/UI.Gets the Java-style username for a player.For Bedrock players, this will return the username Floodgate assigns for use in Java context. For Java players, this returns the actual Bukkit name. ⚠️ DEPRECATED: Do not use usernames for identity comparisons.
Usernames are not unique or stable across both Java and Bedrock. UsegetNormalizedUUID(Player)
instead.- Parameters:
player
- the player- Returns:
- the correct Java-style username for display purposes only
-
getCorrectUniqueId
Retrieves the normalized (Java-style) UUID for a given player.If the player is a Bedrock client connecting through Floodgate, this returns the UUID that Floodgate maps to for consistent identity tracking. Otherwise, returns the player's original Bukkit UUID.
- Parameters:
player
- the player to normalize- Returns:
- the correct UUID representing the player in Java context
-
getCorrectUniqueId
Gets the Java-corrected unique UUID for the given UUID.If the UUID belongs to a Floodgate (Bedrock) player, this will return the mapped Java UUID. If not, the original UUID is returned.
- Parameters:
uuid
- the UUID to normalize- Returns:
- the Java UUID if Bedrock, or the original UUID
-