Skip to content

Commit

Permalink
fallback to duel world if no winner location
Browse files Browse the repository at this point in the history
  • Loading branch information
not-coded committed Aug 3, 2024
1 parent 2e1959d commit 12339e7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ public void registerListener() {
player.getInventory().clear();
LobbyUtil.giveItems(player);

Location respawn = new Location(0,80, 0, WorldUtil.getWorld(duelsGame.level));

if(duelsGame.winner != null) {
respawn = duelsGame.winner.getLocation();
}

respawnEvent.setRespawnMode(Minecraft.GameMode.SPECTATOR);
respawnEvent.setSpawnpoint(duelsGame.winner.getLocation());
respawnEvent.setSpawnpoint(respawn);
} else if(teamDuelsGame != null && duelsData.duelOptions.duelsTeam != null) {
player.getInventory().clear();
LobbyUtil.giveItems(player);
Expand Down

0 comments on commit 12339e7

Please sign in to comment.