Cmd.java 713 B

1234567891011121314151617181920212223242526272829303132
  1. package de.Linus122.customoregen;
  2. import java.io.IOException;
  3. import org.bukkit.command.Command;
  4. import org.bukkit.command.CommandExecutor;
  5. import org.bukkit.command.CommandSender;
  6. public class Cmd implements CommandExecutor {
  7. Main main;
  8. public Cmd(Main main) {
  9. this.main = main;
  10. }
  11. public boolean onCommand(CommandSender cs, Command arg1, String arg2,
  12. String[] arg3) {
  13. if(!cs.hasPermission("customoregen.admin")){
  14. cs.sendMessage("You dont have permissions.");
  15. }else{
  16. try {
  17. main.reload();
  18. } catch (IOException e) {
  19. // TODO Auto-generated catch block
  20. e.printStackTrace();
  21. }
  22. cs.sendMessage("§aConfig reloaded!");
  23. }
  24. return true;
  25. }
  26. }