Interface PlatformPlayerAdapter
public interface PlatformPlayerAdapter
Platform adapter for player-related operations in FlectonePulse.
Abstracts platform-specific player APIs for cross-platform compatibility.
- Since:
- 0.8.1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordPlayer coordinates in the world.static final recordPlayer statistics. -
Method Summary
Modifier and TypeMethodDescription@Nullable ObjectconvertToPlatformPlayer(@NonNull UUID uuid) Converts a UUID to a platform player object.default @Nullable ObjectconvertToPlatformPlayer(@NonNull FEntity entity) doubleCalculates distance between two players.default doublefindPlayersWhoCanSee(UUID uuid, double x, double y, double z) Finds players who can see a location.findPlayersWhoCanSee(@NonNull FEntity entity, double x, double y, double z) @Nullable PlatformPlayerAdapter.CoordinatesgetCoordinates(@NonNull UUID uuid) Gets player coordinates.default @Nullable PlatformPlayerAdapter.CoordinatesgetCoordinates(@NonNull FEntity entity) intgetEntityId(@NonNull UUID uuid) Gets the entity ID of a player.default intgetEntityId(@NonNull FEntity entity) @NonNull StringgetEntityTranslationKey(@Nullable Object platformPlayer) Gets the entity translation key for a player.@NonNull StringgetGamemode(@NonNull UUID uuid) Gets the player game mode.default @NonNull StringgetGamemode(@NonNull FEntity entity) @Nullable StringGets the player IP address.default @Nullable String@Nullable ObjectGets the item in the player's hand.default @Nullable Object@NonNull String@NonNull StringGets the player name from a platform player object.@NonNull StringGets the player name by UUID.default @NonNull StringGets all online player UUIDs.getPassengers(UUID uuid) Gets passengers of a player's vehicle.getPassengers(@NonNull FEntity entity) int@Nullable PlayTimegetPlayedTime(FPlayer fPlayer) Gets the total played time for a player.@Nullable UUIDgetPlayerByEntityId(int entityId) Gets the player UUID by entity ID.@Nullable Class<?> Gets the platform player class.@NonNull net.kyori.adventure.text.ComponentgetPlayerListFooter(@NonNull FPlayer fPlayer) Gets the player list footer.@NonNull net.kyori.adventure.text.ComponentgetPlayerListHeader(@NonNull FPlayer fPlayer) Gets the player list header.@Nullable PlatformPlayerAdapter.StatisticsgetStatistics(@NonNull UUID uuid) Gets player statistics.default @Nullable PlatformPlayerAdapter.StatisticsgetStatistics(@NonNull FEntity entity) @Nullable net.kyori.adventure.text.object.PlayerHeadObjectContents.ProfilePropertygetTexture(@NonNull UUID uuid) Gets the player head texture properties.default @Nullable net.kyori.adventure.text.object.PlayerHeadObjectContents.ProfilePropertygetTexture(@NonNull FEntity entity) @Nullable UUIDGets the UUID from a platform player object.@NonNull StringgetWorldEnvironment(@NonNull UUID uuid) Gets the world environment where the player is located.default @NonNull StringgetWorldEnvironment(@NonNull FEntity entity) @NonNull StringgetWorldName(@NonNull UUID uuid) Gets the world name where the player is located.default @NonNull StringgetWorldName(@NonNull FEntity entity) booleanhasPlayedBefore(@NonNull UUID uuid) Checks if the player has played before.default booleanhasPlayedBefore(@NonNull FEntity entity) booleanhasPotionEffect(@NonNull UUID uuid, @NonNull String potionType) Checks if the player has a potion effect.default booleanhasPotionEffect(@NonNull FEntity entity, @NonNull String potionType) booleanChecks if the object represents the console.booleanChecks if the player is online.default booleanbooleanisOperator(@NonNull UUID uuid) Checks if the player is an operator.default booleanisOperator(@NonNull FEntity entity) booleanisSneaking(@NonNull UUID uuid) Checks if the player is sneaking.default booleanisSneaking(@NonNull FEntity entity) voidKicks a player from the server with a specified reason.voidupdateInventory(@NonNull UUID uuid) Updates the player's inventory.default voidupdateInventory(@NonNull FEntity entity)
-
Method Details
-
getEntityId
Gets the entity ID of a player.- Parameters:
uuid- the player UUID- Returns:
- the entity ID
-
getEntityId
-
getPlayerByEntityId
Gets the player UUID by entity ID.- Parameters:
entityId- the entity ID- Returns:
- the player UUID, or null if not found
-
getUUID
-
getPlayerClass
@Nullable Class<?> getPlayerClass()Gets the platform player class.- Returns:
- the player class, or null if not available
-
convertToPlatformPlayer
-
convertToPlatformPlayer
-
getName
-
getName
-
getName
-
getPing
-
getWorldName
-
getWorldName
-
getWorldEnvironment
-
getWorldEnvironment
-
getLocale
-
getIp
-
getIp
-
getEntityTranslationKey
-
getTexture
@Nullable net.kyori.adventure.text.object.PlayerHeadObjectContents.ProfileProperty getTexture(@NonNull UUID uuid) Gets the player head texture properties.- Parameters:
uuid- the player UUID- Returns:
- the texture properties, or null if not available
-
getTexture
default @Nullable net.kyori.adventure.text.object.PlayerHeadObjectContents.ProfileProperty getTexture(@NonNull FEntity entity) -
getGamemode
-
getGamemode
-
getPlayerListHeader
Gets the player list header.- Parameters:
fPlayer- the player- Returns:
- the header component
-
getStatistics
Gets player statistics.- Parameters:
uuid- the player UUID- Returns:
- the statistics, or null if not available
-
getStatistics
-
getCoordinates
Gets player coordinates.- Parameters:
uuid- the player UUID- Returns:
- the coordinates, or null if not available
-
getCoordinates
-
distance
-
distance
-
isConsole
Checks if the object represents the console.- Parameters:
platformPlayer- the platform player object- Returns:
- true if console
-
isOperator
Checks if the player is an operator.- Parameters:
uuid- the player UUID- Returns:
- true if operator
-
isOperator
-
isSneaking
Checks if the player is sneaking.- Parameters:
uuid- the player UUID- Returns:
- true if sneaking
-
isSneaking
-
hasPlayedBefore
Checks if the player has played before.- Parameters:
uuid- the player UUID- Returns:
- true if has played before
-
hasPlayedBefore
-
hasPotionEffect
-
hasPotionEffect
-
isOnline
Checks if the player is online.- Parameters:
uuid- the player UUID- Returns:
- true if online
-
isOnline
-
updateInventory
Updates the player's inventory.- Parameters:
uuid- the player UUID
-
updateInventory
-
getItem
-
getItem
-
getOnlinePlayers
-
findPlayersWhoCanSee
-
findPlayersWhoCanSee
-
getPassengers
-
getPassengers
-
getPlayedTime
-
kick
Kicks a player from the server with a specified reason.- Parameters:
fPlayer- the player to kickreason- the reason for kicking, displayed to the player
-