public void onPlayerRespawn(final PlayerRespawnEvent event) { final User user = ess.getUser(event.getPlayer()); if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty()) { return; } if (ess.getSettings().getRespawnAtHome()) { Location home; final Location bed = user.getBedSpawnLocation(); if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK) { home = bed; } else { home = user.getHome(user.getLocation()); } if (home != null) { event.setRespawnLocation(home); return; } } final Location spawn = spawns.getSpawn(user.getGroup()); if (spawn != null) { event.setRespawnLocation(spawn); } }
@Override public void onPlayerRespawn(final PlayerRespawnEvent event) { final User user = ess.getUser(event.getPlayer()); if (ess.getSettings().getRespawnAtHome()) { Location home = user.getHome(user.getLocation()); if (home == null) { home = user.getBedSpawnLocation(); } if (home != null) { event.setRespawnLocation(home); return; } } final Location spawn = spawns.getSpawn(user.getGroup()); if (spawn != null) { event.setRespawnLocation(spawn); } }