Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TurboCommand implements CommandExecutor {
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (!(sender instanceof Player)) {
- return true;
- }
- Player p = (Player)sender;
- if (!sender.hasPermission("sop3kdrop.turbo")) {
- return ChatUtil.sendMessage(p, "&cNie posidasz dostepu do tej komendy! &8(&7konczel.cmd.turbo&8)");
- }
- if (args.length < 3) {
- return ChatUtil.sendMessage(p, "&cPoprawne uzycie &7/turbo <drop|exp> <all|gracz> <czas>");
- }
- long time = TimeUtil.parseDateDiff(args[2], true);
- String s = args[0];
- String s3;
- String s2 = s3 = s;
- String s4;
- String s5;
- switch (s5 = (s4 = s3)) {
- case "exp": {
- if (args[1].equalsIgnoreCase("all")) {
- Settings.TURBO_EXP = time;
- Settings.saveSettings();
- Bukkit.broadcastMessage(ChatUtil.fix("&8>> &6Na serwerze zostal aktywowany &f&lTURBOEXP &6na &f" + TimeUtil.secondsToString(time)));
- return true;
- }
- User u = UserManager.getUser(args[1]);
- if (u == null) {
- return ChatUtil.sendMessage(p, "&4BLAD: &cPodany gracz jest offline!");
- }
- u.setTurboExp(time);
- if (u.getPlayer() != null) {
- ChatUtil.sendMessage(u.getPlayer(), "&8>> &6Otrzymales &F&lTURBOEXP &6na &f" + TimeUtil.secondsToString(time));
- }
- return ChatUtil.sendMessage(p, "&8>> &6Nales &F&lTURBOEXP &6dla gracza &f" + TimeUtil.secondsToString(time) + " &6do &f" + u.getName());
- }
- case "drop": {
- if (args[1].equalsIgnoreCase("all")) {
- Settings.TURBO_DROP = time;
- Settings.saveSettings();
- Bukkit.broadcastMessage(ChatUtil.fix("&8>> &6Na serwerze zostal aktywowany &f&lTURBODROP &6na &f" + TimeUtil.secondsToString(time)));
- return true;
- }
- User u = UserManager.getUser(args[1]);
- if (u == null) {
- return ChatUtil.sendMessage(p, "&4BLAD: &cPodany gracz jest offline!");
- }
- u.setTurboDrop(time);
- if (u.getPlayer() != null) {
- ChatUtil.sendMessage(u.getPlayer(), "&8>> &6Otrzymales &f&lTURBODROP &6na &f" + TimeUtil.secondsToString(time));
- }
- return ChatUtil.sendMessage(p, "&8>> &6Nales &F&lTURBODROP &6dla gracza &f" + TimeUtil.secondsToString(time) + " &6do &f" + u.getName());
- }
- default:
- break;
- }
- return ChatUtil.sendMessage(p, "&cPoprawne uzycie &7/turbo <drop|exp> <all|gracz> <czas>");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement