Package com.bekvon.bukkit.residence.event

Examples of com.bekvon.bukkit.residence.event.ResidenceTPEvent


                reqPlayer.sendMessage(ChatColor.RED + Residence.getLanguage().getPhrase("TeleportNoFlag"));
                return;
            }
        }
        if (tpLoc != null) {
            ResidenceTPEvent tpevent = new ResidenceTPEvent(this, tpLoc, targetPlayer, reqPlayer);
            Residence.getServ().getPluginManager().callEvent(tpevent);
            if (!tpevent.isCancelled()) {
                targetPlayer.teleport(tpLoc);
                targetPlayer.sendMessage(ChatColor.GREEN + Residence.getLanguage().getPhrase("TeleportSuccess"));
            }
        } else {
            CuboidArea area = areas.values().iterator().next();
            if (area == null) {
                reqPlayer.sendMessage(ChatColor.RED + "Could not find area to teleport to...");
                return;
            }
            Location targloc = this.getOutsideFreeLoc(area.getHighLoc());
            ResidenceTPEvent tpevent = new ResidenceTPEvent(this, targloc, targetPlayer, reqPlayer);
            Residence.getServ().getPluginManager().callEvent(tpevent);
            if (!tpevent.isCancelled()) {
                targetPlayer.teleport(targloc);
                targetPlayer.sendMessage(ChatColor.YELLOW + Residence.getLanguage().getPhrase("TeleportNear"));
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.bekvon.bukkit.residence.event.ResidenceTPEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.