Class BedrockNameResolver
java.lang.Object
com.bencodez.advancedcore.api.bedrock.BedrockNameResolver
Resolves Bedrock player names and detects Bedrock players.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBedrock detection using Floodgate and Geyser APIs.static final classResult of name resolution containing the final name, Bedrock status, and rationale. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Bedrock name resolver. -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the cache and case-insensitive index.getPrefixedIfBedrock(String name) Get the prefixed name if the player is a Bedrock player.booleanChecks if a player is a Bedrock player by name.booleanChecks if a player is a Bedrock player by UUID and name.booleanisBedrockName(String name) Detect whether a name corresponds to a Bedrock player.voidlearn(AdvancedCoreUser user) Learns whether a user is a Bedrock player.voidlearn(org.bukkit.entity.Player player) Learns whether a player is a Bedrock player.Resolve a name to its canonical form and determine if it's a Bedrock player.resolveWithoutDb(String incomingName)
-
Constructor Details
-
BedrockNameResolver
Creates a new Bedrock name resolver.- Parameters:
plugin- the plugin instance
-
-
Method Details
-
isBedrock
Checks if a player is a Bedrock player by name.- Parameters:
name- the player name- Returns:
- true if the player is a Bedrock player
-
isBedrock
Checks if a player is a Bedrock player by UUID and name.- Parameters:
uuid- the player UUIDname- the player name- Returns:
- true if the player is a Bedrock player
-
learn
Learns whether a user is a Bedrock player.- Parameters:
user- the user to learn from
-
learn
public void learn(org.bukkit.entity.Player player) Learns whether a player is a Bedrock player.- Parameters:
player- the player to learn from
-
isBedrockName
Detect whether a name corresponds to a Bedrock player. IMPORTANT: This method does NOT add prefixes. It only returns a boolean. Useresolve(String)if you want canonical (possibly prefixed) names.- Parameters:
name- the player name- Returns:
- true if the player is a Bedrock player
-
resolve
Resolve a name to its canonical form and determine if it's a Bedrock player.- Parameters:
incomingName- the player name to resolve- Returns:
- the result containing the canonical name and Bedrock status
-
resolveWithoutDb
-
getPrefixedIfBedrock
Get the prefixed name if the player is a Bedrock player.- Parameters:
name- the player name- Returns:
- the prefixed name if Bedrock, otherwise the original name
-
clearCache
public void clearCache()Clear the cache and case-insensitive index.
-