Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### HELPOP ######
- package xyz.wda1234.core.commands.core;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import xyz.wda1234.core.commands.CustomCommand;
- import xyz.wda1234.core.enums.GroupType;
- import xyz.wda1234.core.manager.UserManager;
- import xyz.wda1234.core.utils.ChatUtil;
- /**
- * Created by Dawid_2 on 2015-11-10.
- */
- public class HelpOpCommand extends CustomCommand {
- public HelpOpCommand(String command, GroupType type) {
- super(command, type);
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (UserManager.getUser((Player) sender).getChat().isMuted()){
- sender.sendMessage(ChatUtil.fixColors("&cJestes wyciszony !"));
- return true;
- }
- if (args.length > 0) {
- String message = "";
- for (int i = 0; i < args.length; i++) {
- message = message + args[i] + " ";
- }
- ChatUtil.sendMessageToAllOP(ChatUtil.fixColors("&cHelpOP "+sender.getName()+" &7"+message));
- } else {
- sender.sendMessage(ChatUtil.fixColors("&cPoprawne uzycie komendy /helpop TEKST"));
- }
- return true;
- }
- }
- #### CHATUTIL ZMIENNA OD OPA ####
- public static void sendMessageToAllOP(String mess) {
- for (Player player : Bukkit.getServer().getOnlinePlayers()) {
- if (UserManager.getUser(player).getGroup().can(GroupType.HELPER)) {
- player.sendMessage(mess);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement