Package one.tranic.t.base.command.source
Class SystemCommandSource<C,R>
java.lang.Object
one.tranic.t.base.command.source.SystemCommandSource<C,R>
- All Implemented Interfaces:
CommandSource<C,R>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintargSize()Retrieves the number of arguments associated with the source.asPlayer()Attempts to retrieve the source as aPlayer.abstract voidbroadcastMessage(@NotNull String message) abstract voidbroadcastMessage(@NotNull net.kyori.adventure.text.Component message) voidClears all boss bars currently shown to the source.voidClears any currently displayed title for the associated entity or source.String[]getArgs()Retrieves the arguments associated with the source.@Nullable LocaleRetrieves the locale associated with this source, identifying the language and regional preferences set for the source.booleanhasPermission(String permission) Checks if the entity associated with this source has the specified permission.voidhideBossBar(@NotNull net.kyori.adventure.bossbar.BossBar bossBar) Hides the specified boss bar from the associated source.booleanDetermines if the entity associated with this source is a Bedrock player.booleanisPlayer()Determines if the entity represented by this source is a player.voidshowBossBar(@NotNull net.kyori.adventure.bossbar.BossBar bossBar) Displays the specified BossBar to the source.voidshowTitle(@NotNull net.kyori.adventure.title.Title title) Displays the specified title to the command source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.tranic.t.base.command.source.CommandSource
getOperator, getSource, sendMessage, sendMessage
-
Constructor Details
-
SystemCommandSource
public SystemCommandSource()
-
-
Method Details
-
isBedrockPlayer
public boolean isBedrockPlayer()Description copied from interface:CommandSourceDetermines if the entity associated with this source is a Bedrock player.- Specified by:
isBedrockPlayerin interfaceCommandSource<C,R> - Returns:
- true if the source entity is a Bedrock player, otherwise false
-
isPlayer
public boolean isPlayer()Description copied from interface:CommandSourceDetermines if the entity represented by this source is a player.- Specified by:
isPlayerin interfaceCommandSource<C,R> - Returns:
- true if the source is a player, otherwise false
-
getArgs
Description copied from interface:CommandSourceRetrieves the arguments associated with the source. The arguments are typically used to provide additional information or parameters related to a command or action.- Specified by:
getArgsin interfaceCommandSource<C,R> - Returns:
- an array of strings representing the arguments associated with the source
-
argSize
public int argSize()Description copied from interface:CommandSourceRetrieves the number of arguments associated with the source.- Specified by:
argSizein interfaceCommandSource<C,R> - Returns:
- the number of arguments as an integer.
-
getLocale
Description copied from interface:CommandSourceRetrieves the locale associated with this source, identifying the language and regional preferences set for the source.- Specified by:
getLocalein interfaceCommandSource<C,R> - Returns:
- the locale representing the language and region preferences, or null
if the client is not connected to any server.
If the source is not a player, it returns the environment's default locale.
-
hasPermission
Description copied from interface:CommandSourceChecks if the entity associated with this source has the specified permission.- Specified by:
hasPermissionin interfaceCommandSource<C,R> - Parameters:
permission- the permission node to check for- Returns:
- true if the entity has the specified permission, otherwise false
-
showBossBar
public void showBossBar(@NotNull @NotNull net.kyori.adventure.bossbar.BossBar bossBar) Description copied from interface:CommandSourceDisplays the specified BossBar to the source. The BossBar provides visual feedback typically used to represent progress, health, or timed events in a graphical interface.- Specified by:
showBossBarin interfaceCommandSource<C,R> - Parameters:
bossBar- the BossBar to be displayed; must not be null
-
hideBossBar
public void hideBossBar(@NotNull @NotNull net.kyori.adventure.bossbar.BossBar bossBar) Description copied from interface:CommandSourceHides the specified boss bar from the associated source.- Specified by:
hideBossBarin interfaceCommandSource<C,R> - Parameters:
bossBar- the boss bar to be hidden; must not be null
-
clearBossBars
public void clearBossBars()Description copied from interface:CommandSourceClears all boss bars currently shown to the source.This method removes all active boss bar instances displayed to the command source, ensuring a clean slate without any remaining visual indicators associated with boss bars.
- Specified by:
clearBossBarsin interfaceCommandSource<C,R>
-
showTitle
public void showTitle(@NotNull @NotNull net.kyori.adventure.title.Title title) Description copied from interface:CommandSourceDisplays the specified title to the command source.- Specified by:
showTitlein interfaceCommandSource<C,R> - Parameters:
title- the title to be shown; must not be null
-
clearTitle
public void clearTitle()Description copied from interface:CommandSourceClears any currently displayed title for the associated entity or source. This method is intended to remove any active on-screen title graphics, including subtitles, from the user's view.- Specified by:
clearTitlein interfaceCommandSource<C,R>
-
broadcastMessage
public abstract void broadcastMessage(@NotNull @NotNull net.kyori.adventure.text.Component message) -
broadcastMessage
-
asPlayer
Description copied from interface:CommandSourceAttempts to retrieve the source as aPlayer. If the source does not represent a player, this method will returnnull.- Specified by:
asPlayerin interfaceCommandSource<C,R> - Returns:
- a
Player<R>instance if the source is a player, ornullif the source is not a player.
-