Package wtf.choco.veinminer.platform
Class BukkitPlatformPlayer
java.lang.Object
wtf.choco.veinminer.platform.BukkitPlatformPlayer
- All Implemented Interfaces:
PlatformCommandSender
,PlatformPlayer
Bukkit implementation of
PlatformPlayer
.-
Method Summary
Modifier and TypeMethodDescriptionboolean
@NotNull GameMode
Get theGameMode
of this player.@NotNull ItemStack
Get theItemStack
in the player's main hand.@NotNull String
getName()
Get the name of this sender.@Nullable Player
Get the BukkitPlayer
represented by thisBukkitPlatformPlayer
, or null if the player is not online.@NotNull Player
Get the BukkitPlayer
represented by thisBukkitPlatformPlayer
, or throw anIllegalStateException
if the player is not online.@NotNull RayTraceResult
getTargetBlock
(int distance) Get the block the player is looking at within the given distance.@NotNull UUID
Get theUUID
of this player.@NotNull BlockAccessor
getWorld()
Get theworld
in which this player currently resides.int
hashCode()
boolean
hasPermission
(@NotNull String permission) Check whether or not this sender has the given permission.boolean
isOnline()
Check whether or not this player is online the server.boolean
Check whether or not this player is sneaking.void
Kick this player from the server with the given disconnect message.void
sendMessage
(@NotNull String message) Send a message.void
sendPluginMessage
(@NotNull NamespacedKey channel, byte[] message) Send a plugin message to this player over the given channel.
-
Method Details
-
isOnline
public boolean isOnline()Description copied from interface:PlatformPlayer
Check whether or not this player is online the server.- Specified by:
isOnline
in interfacePlatformPlayer
- Returns:
- true if online, false if offline
-
getName
Description copied from interface:PlatformCommandSender
Get the name of this sender.- Specified by:
getName
in interfacePlatformCommandSender
- Returns:
- the name
-
getWorld
Description copied from interface:PlatformPlayer
Get theworld
in which this player currently resides.- Specified by:
getWorld
in interfacePlatformPlayer
- Returns:
- the world
-
getItemInMainHand
Description copied from interface:PlatformPlayer
Get theItemStack
in the player's main hand.- Specified by:
getItemInMainHand
in interfacePlatformPlayer
- Returns:
- the item stack
-
getTargetBlock
Description copied from interface:PlatformPlayer
Get the block the player is looking at within the given distance. If the player is looking at a block that exceeds the given distance, the result will be empty.- Specified by:
getTargetBlock
in interfacePlatformPlayer
- Parameters:
distance
- the maximum block distance- Returns:
- the result of the ray trace
-
getUniqueId
Description copied from interface:PlatformPlayer
Get theUUID
of this player.- Specified by:
getUniqueId
in interfacePlatformPlayer
- Returns:
- the uuid
-
sendMessage
Description copied from interface:PlatformCommandSender
Send a message.- Specified by:
sendMessage
in interfacePlatformCommandSender
- Parameters:
message
- the message to send
-
hasPermission
Description copied from interface:PlatformCommandSender
Check whether or not this sender has the given permission.- Specified by:
hasPermission
in interfacePlatformCommandSender
- Parameters:
permission
- the permission to check- Returns:
- true if the sender has the given permission, false otherwise
-
getGameMode
Description copied from interface:PlatformPlayer
Get theGameMode
of this player.- Specified by:
getGameMode
in interfacePlatformPlayer
- Returns:
- the game mode
-
isSneaking
public boolean isSneaking()Description copied from interface:PlatformPlayer
Check whether or not this player is sneaking.- Specified by:
isSneaking
in interfacePlatformPlayer
- Returns:
- true if sneaking, false otherwise
-
sendPluginMessage
Description copied from interface:PlatformPlayer
Send a plugin message to this player over the given channel.- Specified by:
sendPluginMessage
in interfacePlatformPlayer
- Parameters:
channel
- the channel on which to send the messagemessage
- the message contents
-
kick
Description copied from interface:PlatformPlayer
Kick this player from the server with the given disconnect message.- Specified by:
kick
in interfacePlatformPlayer
- Parameters:
message
- the disconnect message
-
getPlayer
Get the BukkitPlayer
represented by thisBukkitPlatformPlayer
, or null if the player is not online.- Returns:
- the player, or null
-
getPlayerOrThrow
Get the BukkitPlayer
represented by thisBukkitPlatformPlayer
, or throw anIllegalStateException
if the player is not online.- Returns:
- the player
-
hashCode
public int hashCode() -
equals
-