AdminChatMessage.java 868 B

123456789101112131415161718192021222324
  1. package com.gmail.nossr50.chat.message;
  2. import com.gmail.nossr50.chat.author.Author;
  3. import com.gmail.nossr50.datatypes.chat.ChatChannel;
  4. import net.kyori.adventure.audience.Audience;
  5. import net.kyori.adventure.text.TextComponent;
  6. import org.bukkit.plugin.Plugin;
  7. import org.jetbrains.annotations.NotNull;
  8. public class AdminChatMessage extends AbstractChatMessage {
  9. public AdminChatMessage(@NotNull Plugin pluginRef, @NotNull Author author, @NotNull Audience audience, @NotNull String rawMessage, @NotNull TextComponent componentMessage) {
  10. super(pluginRef, author, audience, rawMessage, componentMessage);
  11. }
  12. @Override
  13. public void sendMessage() {
  14. audience.sendMessage(author, componentMessage);
  15. }
  16. @Override
  17. public @NotNull String getAuthorDisplayName() {
  18. return author.getAuthoredName(ChatChannel.ADMIN);
  19. }
  20. }