Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(cmd.getName().equalsIgnoreCase("forcechannel")){
- if(getMetadata(admin, "durpchat.canmute", plugin)==true)
- {
- // plugin.getServer().getLogger().info("Got Mute!");
- if (args.length < 2)
- {
- // plugin.getServer().getLogger().info("Command is /derpmute [player] [channel]");
- // if (!(admin==null))
- // {
- // admin.sendMessage("Command is /derpmute [player] [channel]");
- //
- // }
- return false;
- }
- if(args.length == 2){
- Player player = Bukkit.getServer().getPlayer(args [0]);
- for(ChatChannel chname:cc.getChannelsInfo())
- player.setMetadata("listenchannel."+chname.getName(),new FixedMetadataValue(plugin,true));
- for(ChatChannel chname:cc.getChannelsInfo())
- player.setMetadata("currentchannel",new FixedMetadataValue(plugin,chname.getName()));
- }
- Player player = null;
- player = sender.getServer().getPlayerExact(args[0]);
- if(player == null)
- {
- // plugin.getServer().getLogger().info("Can't mute. Player "+ args[0] + " doesn't exist.");
- if (!(admin==null))
- {
- admin.sendMessage(ChatColor.RED+"Can't mute. Player "+ args[0] + " doesn't exist.");
- }
- return false;
- }
- for(ChatChannel c:cc.getChannelsInfo())
- {
- if(c.getName().equalsIgnoreCase(args[1])|| c.getAlias().equalsIgnoreCase(args[1]))
- {
- player.setMetadata("durpMute."+c.getName(),new FixedMetadataValue(plugin,true));
- admin.sendMessage(ChatColor.RED+"Muted Player "+ args[0] + " in " + c.getName());
- return true;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment