Class SystemCommandSource<C,R>

java.lang.Object
one.tranic.t.base.command.source.SystemCommandSource<C,R>
All Implemented Interfaces:
CommandSource<C,R>

public abstract class SystemCommandSource<C,R> extends Object implements CommandSource<C,R>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Retrieves the number of arguments associated with the source.
    @Nullable Player<R>
    Attempts to retrieve the source as a Player.
    abstract void
    broadcastMessage(@NotNull String message)
     
    abstract void
    broadcastMessage(@NotNull net.kyori.adventure.text.Component message)
     
    void
    Clears all boss bars currently shown to the source.
    void
    Clears any currently displayed title for the associated entity or source.
    Retrieves the arguments associated with the source.
    @Nullable Locale
    Retrieves the locale associated with this source, identifying the language and regional preferences set for the source.
    boolean
    hasPermission(String permission)
    Checks if the entity associated with this source has the specified permission.
    void
    hideBossBar(@NotNull net.kyori.adventure.bossbar.BossBar bossBar)
    Hides the specified boss bar from the associated source.
    boolean
    Determines if the entity represented by this source is a player.
    void
    showBossBar(@NotNull net.kyori.adventure.bossbar.BossBar bossBar)
    Displays the specified BossBar to the source.
    void
    showTitle(@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, wait

    Methods inherited from interface one.tranic.t.base.command.source.CommandSource

    getOperator, getSource, sendMessage, sendMessage
  • Constructor Details

    • SystemCommandSource

      public SystemCommandSource()
  • Method Details

    • isPlayer

      public boolean isPlayer()
      Description copied from interface: CommandSource
      Determines if the entity represented by this source is a player.
      Specified by:
      isPlayer in interface CommandSource<C,R>
      Returns:
      true if the source is a player, otherwise false
    • getArgs

      public String[] getArgs()
      Description copied from interface: CommandSource
      Retrieves 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:
      getArgs in interface CommandSource<C,R>
      Returns:
      an array of strings representing the arguments associated with the source
    • argSize

      public int argSize()
      Description copied from interface: CommandSource
      Retrieves the number of arguments associated with the source.
      Specified by:
      argSize in interface CommandSource<C,R>
      Returns:
      the number of arguments as an integer.
    • getLocale

      @Nullable public @Nullable Locale getLocale()
      Description copied from interface: CommandSource
      Retrieves the locale associated with this source, identifying the language and regional preferences set for the source.
      Specified by:
      getLocale in interface CommandSource<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

      public boolean hasPermission(String permission)
      Description copied from interface: CommandSource
      Checks if the entity associated with this source has the specified permission.
      Specified by:
      hasPermission in interface CommandSource<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: CommandSource
      Displays 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:
      showBossBar in interface CommandSource<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: CommandSource
      Hides the specified boss bar from the associated source.
      Specified by:
      hideBossBar in interface CommandSource<C,R>
      Parameters:
      bossBar - the boss bar to be hidden; must not be null
    • clearBossBars

      public void clearBossBars()
      Description copied from interface: CommandSource
      Clears 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:
      clearBossBars in interface CommandSource<C,R>
    • showTitle

      public void showTitle(@NotNull @NotNull net.kyori.adventure.title.Title title)
      Description copied from interface: CommandSource
      Displays the specified title to the command source.
      Specified by:
      showTitle in interface CommandSource<C,R>
      Parameters:
      title - the title to be shown; must not be null
    • clearTitle

      public void clearTitle()
      Description copied from interface: CommandSource
      Clears 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:
      clearTitle in interface CommandSource<C,R>
    • broadcastMessage

      public abstract void broadcastMessage(@NotNull @NotNull net.kyori.adventure.text.Component message)
    • broadcastMessage

      public abstract void broadcastMessage(@NotNull @NotNull String message)
    • asPlayer

      @Nullable public @Nullable Player<R> asPlayer()
      Description copied from interface: CommandSource
      Attempts to retrieve the source as a Player. If the source does not represent a player, this method will return null.
      Specified by:
      asPlayer in interface CommandSource<C,R>
      Returns:
      a Player<R> instance if the source is a player, or null if the source is not a player.