Plex/server/src/main/java/dev/plex/command/impl/SayCMD.java

31 lines
1.2 KiB
Java
Raw Normal View History

2022-04-10 05:10:35 +00:00
package dev.plex.command.impl;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import net.kyori.adventure.text.Component;
2022-06-08 20:09:42 +00:00
import org.apache.commons.lang3.StringUtils;
2022-04-10 05:10:35 +00:00
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@CommandPermissions(level = Rank.ADMIN, permission = "plex.say", source = RequiredCommandSource.ANY)
@CommandParameters(name = "say", usage = "/<command> <message>", description = "Displays a message to everyone")
public class SayCMD extends PlexCommand
{
@Override
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, String[] args)
{
if (args.length == 0)
{
return usage();
}
2022-04-13 02:20:56 +00:00
PlexUtils.broadcast(PlexUtils.messageComponent("sayMessage", sender.getName(), PlexUtils.mmStripColor(StringUtils.join(args, " "))));
2022-04-10 05:10:35 +00:00
return null;
}
}