Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. public class EnableCommand extends Command {
  2.  
  3. public EnableCommand() {
  4. super(
  5. Commands.CORE_USER_ENABLE_NAME,
  6. Commands.CORE_USER_ENABLE_DESCRIPTION,
  7. Commands.CORE_USER_ENABLE_USAGE,
  8. Commands.CORE_USER_ENABLE_PERMISSION,
  9. Commands.CORE_USER_ENABLE_ALIASES
  10. );
  11. }
  12.  
  13. public boolean onExecute(CommandSender p, String[] args) {
  14. if (args.length < 2) {
  15. return ChatUtil.sendMessage(p, Messages.USE(this.getUsage()));
  16. }
  17. switch (args[0]) {
  18. case "kit": {
  19. boolean check = Boolean.parseBoolean(args[1]);
  20. Settings.ENABLE_KITS = check;
  21. Settings.saveConfig();
  22. return ChatUtil.sendMessage(p, "&8» &7Zestawy zostaly &a&l" + (check ? "wlaczone" : "wylaczone") + "&7!");
  23. }
  24. case "create": {
  25. boolean check = Boolean.parseBoolean(args[1]);
  26. Settings.ENABLE_CREATE = check;
  27. Settings.saveConfig();
  28. return ChatUtil.sendMessage(p, "&8» &7Zakladnie gildii zostalo &a&l" + (check ? "wlaczone" : "wylaczone") + "&7!");
  29. }
  30. case "tour1": {
  31. boolean check = Boolean.parseBoolean(args[1]);
  32. Settings.COST_CREATE_TOUR1_ENABLE = check;
  33. Settings.saveConfig();
  34. return ChatUtil.sendMessage(p, "&8» &7Tura pierwsza itemow zostala &a&l" + (check ? "wlaczona" : "wylaczona") + "&7!");
  35. }
  36. case "tour2": {
  37. boolean check = Boolean.parseBoolean(args[1]);
  38. Settings.COST_CREATE_TOUR2_ENABLE = check;
  39. Settings.saveConfig();
  40. return ChatUtil.sendMessage(p, "&8» &7Tura druga itemow zostala &a&l" + (check ? "wlaczona" : "wylaczona") + "&7!");
  41. }
  42. default: {
  43. return ChatUtil.sendMessage(p, Messages.USE(this.getUsage()));
  44. }
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement