Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. public class TurboCommand implements CommandExecutor {
  2.  
  3. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  4. if (!(sender instanceof Player)) {
  5. return true;
  6. }
  7. Player p = (Player)sender;
  8. if (!sender.hasPermission("sop3kdrop.turbo")) {
  9. return ChatUtil.sendMessage(p, "&cNie posidasz dostepu do tej komendy! &8(&7konczel.cmd.turbo&8)");
  10. }
  11. if (args.length < 3) {
  12. return ChatUtil.sendMessage(p, "&cPoprawne uzycie &7/turbo <drop|exp> <all|gracz> <czas>");
  13. }
  14. long time = TimeUtil.parseDateDiff(args[2], true);
  15. String s = args[0];
  16. String s3;
  17. String s2 = s3 = s;
  18. String s4;
  19. String s5;
  20. switch (s5 = (s4 = s3)) {
  21. case "exp": {
  22. if (args[1].equalsIgnoreCase("all")) {
  23. Settings.TURBO_EXP = time;
  24. Settings.saveSettings();
  25. Bukkit.broadcastMessage(ChatUtil.fix("&8>> &6Na serwerze zostal aktywowany &f&lTURBOEXP &6na &f" + TimeUtil.secondsToString(time)));
  26. return true;
  27. }
  28. User u = UserManager.getUser(args[1]);
  29. if (u == null) {
  30. return ChatUtil.sendMessage(p, "&4BLAD: &cPodany gracz jest offline!");
  31. }
  32. u.setTurboExp(time);
  33. if (u.getPlayer() != null) {
  34. ChatUtil.sendMessage(u.getPlayer(), "&8>> &6Otrzymales &F&lTURBOEXP &6na &f" + TimeUtil.secondsToString(time));
  35. }
  36. return ChatUtil.sendMessage(p, "&8>> &6Nales &F&lTURBOEXP &6dla gracza &f" + TimeUtil.secondsToString(time) + " &6do &f" + u.getName());
  37. }
  38. case "drop": {
  39. if (args[1].equalsIgnoreCase("all")) {
  40. Settings.TURBO_DROP = time;
  41. Settings.saveSettings();
  42. Bukkit.broadcastMessage(ChatUtil.fix("&8>> &6Na serwerze zostal aktywowany &f&lTURBODROP &6na &f" + TimeUtil.secondsToString(time)));
  43. return true;
  44. }
  45. User u = UserManager.getUser(args[1]);
  46. if (u == null) {
  47. return ChatUtil.sendMessage(p, "&4BLAD: &cPodany gracz jest offline!");
  48. }
  49. u.setTurboDrop(time);
  50. if (u.getPlayer() != null) {
  51. ChatUtil.sendMessage(u.getPlayer(), "&8>> &6Otrzymales &f&lTURBODROP &6na &f" + TimeUtil.secondsToString(time));
  52. }
  53. return ChatUtil.sendMessage(p, "&8>> &6Nales &F&lTURBODROP &6dla gracza &f" + TimeUtil.secondsToString(time) + " &6do &f" + u.getName());
  54. }
  55. default:
  56. break;
  57. }
  58. return ChatUtil.sendMessage(p, "&cPoprawne uzycie &7/turbo <drop|exp> <all|gracz> <czas>");
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement