Add Chat Component message methods to CommandSender

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None

      Given a BaseComponent and a CommandSender its necessary to check if the CommandSender is a Player and then cast to use Player.spigot().sendMessage(...) or fall back and translate the component back to text for use with CommandSender.sendMessage(...). It'd be more convenient if the sendMessage methods in Player.spigot() were added to CommandSender.spigot() and then non-Player command senders transparently convert them back to text.

      Essentially feature parity between Player message sending and CommandSender message sending.

          [SPIGOT-3241] Add Chat Component message methods to CommandSender

          zreed added a comment -

          Entity is a sub-interface of CommandSender so that should get around Player.Spigot extending Entity.Spigot. Assuming Entity.Spigot changed to extend CommandSender.Spigot.

          Alternatively the Spigot.sendMessage methods could be deprecated and added to CommandSender directly. I'm not sure the criteria for promoting methods like that though.

          zreed added a comment - Entity is a sub-interface of CommandSender so that should get around Player.Spigot extending Entity.Spigot. Assuming Entity.Spigot changed to extend CommandSender.Spigot. Alternatively the Spigot.sendMessage methods could be deprecated and added to CommandSender directly. I'm not sure the criteria for promoting methods like that though.

          md_5 added a comment -

          This might not be possible in a non breaking manner

          md_5 added a comment - This might not be possible in a non breaking manner

            Assignee:
            Unassigned
            Reporter:
            zreed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: