Advertisement
DSHunterMC

Untitled

Dec 28th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. package me.DylanPerez.plugin;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8.  
  9. public class Reload implements CommandExecutor {
  10.  
  11. @Override
  12. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  13. Player p = (Player) sender;
  14.  
  15. if(sender instanceof Player) {
  16. if(cmd.getName().equalsIgnoreCase("r")) {
  17. if(p.hasPermission("hhf.reload")) {
  18. p.performCommand("reload");
  19. p.sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD + "HexigonH" + ChatColor.RED + "" + ChatColor.BOLD + "F" + ChatColor.DARK_RED + ">> " + ChatColor.RED + "The server has " + ChatColor.DARK_RED + "" + ChatColor.BOLD + "Reloaded!");
  20. } else {
  21. if(!p.hasPermission("hhf.reload")) {
  22. p.sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD + "HexigonH" + ChatColor.RED + "" + ChatColor.BOLD + "F" + ChatColor.DARK_RED + ">> " + ChatColor.RED + "I'm sorry, but I believe this command is not accessable to you. Please contact the server admin to check if this is an error!");
  23. } else {
  24. if(!(sender instanceof Player)) {
  25. System.out.println("Worked!");
  26. }
  27. }
  28. }
  29. }
  30. }
  31.  
  32.  
  33. return false;
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement