Created
August 25, 2013 04:27
-
-
Save heinrichquirit/6332002 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean onCommand(CommandSender sender, Command cmdObj, String lbl, String[] args) { | |
if (!(sender instanceof Player)) { | |
if (cmdObj.getName().equalsIgnoreCase("freeze")) { | |
if (args.length == 1) { | |
Player p = Bukkit.getPlayer(args[0]); | |
if (p != null) { | |
if (!p.hasPermission("freeze.immune") || p.hasPermission("freeze.immune")) { | |
sender.sendMessage("Froze " + p.getName() + " even his immune."); | |
} | |
} | |
} | |
} | |
} else { | |
if (cmdObj.getName().equalsIgnoreCase("freeze")) { | |
if (args.length == 1) { | |
Player p = Bukkit.getPlayer(args[0]); | |
if (p != null) { | |
if (!p.hasPermission("freeze.immune")) { | |
sender.sendMessage("Froze " + p.getName()); | |
} else { | |
sender.sendMessage(p.getName() + " is immune to this command."); | |
} | |
} | |
} | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment