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 GameModeGet theGameModeof this player.@NotNull ItemStackGet theItemStackin the player's main hand.@NotNull StringgetName()Get the name of this sender.@Nullable PlayerGet the BukkitPlayerrepresented by thisBukkitPlatformPlayer, or null if the player is not online.@NotNull PlayerGet the BukkitPlayerrepresented by thisBukkitPlatformPlayer, or throw anIllegalStateExceptionif the player is not online.@NotNull RayTraceResultgetTargetBlock(int distance) Get the block the player is looking at within the given distance.@NotNull UUIDGet theUUIDof this player.@NotNull BlockAccessorgetWorld()Get theworldin which this player currently resides.inthashCode()booleanhasPermission(@NotNull String permission) Check whether or not this sender has the given permission.booleanisOnline()Check whether or not this player is online the server.booleanCheck whether or not this player is sneaking.voidKick this player from the server with the given disconnect message.voidsendMessage(@NotNull String message) Send a message.voidsendPluginMessage(@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:PlatformPlayerCheck whether or not this player is online the server.- Specified by:
isOnlinein interfacePlatformPlayer- Returns:
- true if online, false if offline
-
getName
Description copied from interface:PlatformCommandSenderGet the name of this sender.- Specified by:
getNamein interfacePlatformCommandSender- Returns:
- the name
-
getWorld
Description copied from interface:PlatformPlayerGet theworldin which this player currently resides.- Specified by:
getWorldin interfacePlatformPlayer- Returns:
- the world
-
getItemInMainHand
Description copied from interface:PlatformPlayerGet theItemStackin the player's main hand.- Specified by:
getItemInMainHandin interfacePlatformPlayer- Returns:
- the item stack
-
getTargetBlock
Description copied from interface:PlatformPlayerGet 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:
getTargetBlockin interfacePlatformPlayer- Parameters:
distance- the maximum block distance- Returns:
- the result of the ray trace
-
getUniqueId
Description copied from interface:PlatformPlayerGet theUUIDof this player.- Specified by:
getUniqueIdin interfacePlatformPlayer- Returns:
- the uuid
-
sendMessage
Description copied from interface:PlatformCommandSenderSend a message.- Specified by:
sendMessagein interfacePlatformCommandSender- Parameters:
message- the message to send
-
hasPermission
Description copied from interface:PlatformCommandSenderCheck whether or not this sender has the given permission.- Specified by:
hasPermissionin interfacePlatformCommandSender- Parameters:
permission- the permission to check- Returns:
- true if the sender has the given permission, false otherwise
-
getGameMode
Description copied from interface:PlatformPlayerGet theGameModeof this player.- Specified by:
getGameModein interfacePlatformPlayer- Returns:
- the game mode
-
isSneaking
public boolean isSneaking()Description copied from interface:PlatformPlayerCheck whether or not this player is sneaking.- Specified by:
isSneakingin interfacePlatformPlayer- Returns:
- true if sneaking, false otherwise
-
sendPluginMessage
Description copied from interface:PlatformPlayerSend a plugin message to this player over the given channel.- Specified by:
sendPluginMessagein interfacePlatformPlayer- Parameters:
channel- the channel on which to send the messagemessage- the message contents
-
kick
Description copied from interface:PlatformPlayerKick this player from the server with the given disconnect message.- Specified by:
kickin interfacePlatformPlayer- Parameters:
message- the disconnect message
-
getPlayer
Get the BukkitPlayerrepresented by thisBukkitPlatformPlayer, or null if the player is not online.- Returns:
- the player, or null
-
getPlayerOrThrow
Get the BukkitPlayerrepresented by thisBukkitPlatformPlayer, or throw anIllegalStateExceptionif the player is not online.- Returns:
- the player
-
hashCode
public int hashCode() -
equals
-