}
} else if (message.getStatus() == PlayerStatusMessage.RESPAWN) {
Player player = session.getPlayer();
Point point = player.getWorld().getSpawnPoint().getPosition();
if (PlayerRespawnEvent.getHandlerList().getRegisteredListeners().length > 0) {
PlayerRespawnEvent event = server.getEventManager().callEvent(new PlayerRespawnEvent(player, point));
if (event.isCancelled()) {
return;
}
point = event.getPoint();
}
//Set position for the server
player.getPhysics().setPosition(point);
player.getNetwork().forceRespawn();
Human human = player.add(Human.class);