Skip to content

Commit

Permalink
Added %current_count% placeholder for death messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan923 committed Sep 26, 2020
1 parent 845d383 commit bd5e382
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public void onPlayerDeath(final PlayerDeathEvent event) {
player.spigot().respawn();
event.setDeathMessage(null);

instance.getGameManager().broadcastInGame(formatAll(instance.getLanguageManager().getConfig().getString("Game.Player Died").replace("%player_name%", player.getName())));
instance.getGameManager().broadcastInGame(formatAll(instance.getLanguageManager().getConfig().getString("Game.Player Died")
.replace("%player_name%", player.getName())
.replace("%current_count%", String.valueOf(instance.getPlayers().size()))));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public void onPlayerQuit(final PlayerQuitEvent event) {

GameStatus gameStatus = instance.getGameManager().getStatus();
if (gameStatus.equals(GameStatus.GRACE) || gameStatus.equals(GameStatus.STARTED)) {
instance.getGameManager().broadcastInGame(formatAll(instance.getLanguageManager().getConfig().getString("Game.Player Died").replace("%player_name%", player.getName())));
instance.getGameManager().broadcastInGame(formatAll(instance.getLanguageManager().getConfig().getString("Game.Player Died")
.replace("%player_name%", player.getName())
.replace("%current_count%", String.valueOf(instance.getPlayers().size()))));
}
}

Expand Down

0 comments on commit bd5e382

Please sign in to comment.