Interface IPlayer
- All Superinterfaces:
ISender
-
Method Summary
Modifier and TypeMethodDescriptionvoid
executeCommands
(List<String> commands) Execute the commands that are bundled with this MessageCompoundReturns the locale the player is using.Returns the name of the server the player is on.identity()
Gets the UserIdentity associated with this IPlayer.void
kick
(net.kyori.adventure.text.Component reason) Kicks the player from the server.boolean
Checks if the encapsulated player is the same object as theother
.void
sendActionBar
(String message) Shows the text in the action bar of the player.sendBossbar
(String message, MessageConfiguration.BossBarStyle style, MessageConfiguration.BossBarColor color, int time) Shows a boss bar to the player.void
sendMessage
(String message) Shows the text in the chat of the player.Shows the text as a title to the player.Methods inherited from interface com.gamersafer.minecraft.bans.common.abstraction.ISender
hasPermission, sendMessage
-
Method Details
-
sendActionBar
Shows the text in the action bar of the player.- Parameters:
message
- the message to show
-
sendBossbar
CompletableFuture<Void> sendBossbar(String message, MessageConfiguration.BossBarStyle style, MessageConfiguration.BossBarColor color, int time) Shows a boss bar to the player.- Parameters:
message
- the message to showstyle
- the style of the bossbarcolor
- the color of the bossbartime
- how many seconds should it be shown- Returns:
- a
CompletableFuture
,complete
it to remove the bossbar
-
sendMessage
Shows the text in the chat of the player.- Specified by:
sendMessage
in interfaceISender
- Parameters:
message
- the message to show
-
sendTitle
Shows the text as a title to the player.- Parameters:
message
- the title to showsubmessage
- the subtitle to showtime
- how many seconds should it be shown- Returns:
- a
CompletableFuture
,complete
it to remove the title
-
executeCommands
Execute the commands that are bundled with this MessageCompound- Parameters:
commands
- the commands to execute. %player% with be replaced with the players name
-
identity
UserIdentity identity()Gets the UserIdentity associated with this IPlayer.- Returns:
- the associated UserIdentity
-
kick
void kick(net.kyori.adventure.text.Component reason) Kicks the player from the server. -
same
Checks if the encapsulated player is the same object as theother
.- Parameters:
other
- the other IPlayer- Returns:
- whether the encapsulated players objects are the same
-
getLocale
Locale getLocale()Returns the locale the player is using.- Returns:
- the locale the player is using.
-
getServerName
Returns the name of the server the player is on.- Returns:
- the name of the server the player is on. Optional is empty on non-proxy servers or when the player is not connected to a backend server.
-