Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play match sounds through ambient sound category #717

Merged
merged 7 commits into from
Feb 9, 2021
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ public void onMatchResult(MatchResultEvent event) {
Location location = player.getLocation().clone().add(0.0, 100.0, 0.0);

if (spectators.containsPlayer(player)) {
player.playSound(location, Sound.ENTITY_WITHER_DEATH, 1000, 1);
player.playSound(location, Sound.ENTITY_WITHER_DEATH, 100, 1);
} else {
applyPostPlayer(player);

if (event.getWinningTeam() == null) {
player.sendTitle("", ChatColor.YELLOW + "The result was a tie!", 10, 40, 10);
player.playSound(location, Sound.ENTITY_WITHER_SPAWN, 1000, 1);
player.playSound(location, Sound.ENTITY_WITHER_SPAWN, 100, 1);
} else if (event.getWinningTeam().containsPlayer(player)) {
player.sendTitle("", ChatColor.GREEN + "Your team won!", 10, 40, 10);
player.playSound(location, Sound.ENTITY_WITHER_DEATH, 1000, 1);
player.playSound(location, Sound.ENTITY_WITHER_DEATH, 100, 1);
} else {
player.sendTitle("", ChatColor.RED + "Your team lost!", 10, 40, 10);
player.playSound(location, Sound.ENTITY_WITHER_SPAWN, 1000, 1);
player.playSound(location, Sound.ENTITY_WITHER_SPAWN, 100, 1);
}
}

Expand Down