use of com.alessiodp.parties.common.parties.objects.PartyHomeImpl in project Parties by AlessioDP.
the class BukkitPartiesBungeecordListener method handleHomeTeleport.
public void handleHomeTeleport(PartiesPacket packet) {
PartyPlayerImpl partyPlayer = ((PartiesPlugin) plugin).getPlayerManager().getPlayer(packet.getPlayer());
if (partyPlayer != null) {
User user = plugin.getPlayer(packet.getPlayer());
if (user != null) {
try {
String homeSerialized = packet.getText();
String message = packet.getSecondaryText();
PartyHomeImpl home = PartyHomeImpl.deserialize(homeSerialized);
if (home != null) {
Location location = new Location(Bukkit.getWorld(home.getWorld()), home.getX(), home.getY(), home.getZ(), home.getYaw(), home.getPitch());
BukkitCommandHome.teleportToPartyHome((PartiesPlugin) plugin, partyPlayer, (BukkitUser) user, home, location, message);
plugin.getLoggerManager().logDebug(String.format(PartiesConstants.DEBUG_MESSAGING_LISTEN_HOME_TELEPORT, packet.getPlayer().toString(), homeSerialized), true);
}
} catch (Exception ex) {
plugin.getLoggerManager().logError(PartiesConstants.DEBUG_MESSAGING_LISTEN_HOME_TELEPORT_ERROR, ex);
}
}
}
}
Aggregations