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"));
}
}
}