Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TpaCommand extends PlayerCommand
- {
- public TpaCommand() {
- super("tpa", "Teleport do gracza", "/tpa <gracz>", "core.cmd.tpa", new String[0]);
- }
- public boolean onCommand(final Player p, final String[] args) {
- if (args.length < 1) {
- return ChatUtil.sendMessage(p, Lang.USE(this.getUsage()));
- }
- final Player o = Bukkit.getPlayer(args[0]);
- if (o == null) {
- return ChatUtil.sendMessage(p,"&4Blad: &cGracz offline!");
- }
- final User u = UserManager.getUser(o);
- if (u == null) {
- return true;
- }
- if (u.getTpa().contains(p)) {
- return ChatUtil.sendMessage(p, "&4Blad: &cWyslales juz zaproszenie o teleport do gracza " + o.getName() + "!");
- }
- if (u.getTpahere().contains(p)) {
- u.getTpahere().remove(p);
- }
- u.getTpa().add(p);
- ChatUtil.sendMessage(p, "&8» &7Wyslales zaproszenie o teleport do gracza &6" + o.getName() + "&7!");
- ChatUtil.sendMessage(o, "&8» &7Gracz &6" + p.getName() + " &7chce sie przeteleportowac do Ciebie!");
- ChatUtil.sendMessage(o, "&8» &7Wpisz &6/tpaccept " + p.getName() + " &7aby zaakceptowac!");
- return ChatUtil.sendMessage(o, "&8» &7Wpisz &6/tpdeny " + p.getName() + " &7aby odrzucic!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement