Skip to content

Commit

Permalink
Added more sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Devlrxxh committed Apr 5, 2024
1 parent 5d17fe7 commit 9c191aa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/main/java/me/lrxh/practice/match/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ public void onDeath(Player dead) {
killerProfile.getOptions().killEffect().execute(killer, dead.getLocation());
PlayerUtil.sendTitle(killer, CC.translate("&aVICTORY!"), "&a" + killer.getName() + " &fwon the match!", 70);
killer.playSound(killer.getLocation(), Sound.EXPLODE, 1.0f, 1.0f);
PlayerUtil.doVelocityChange(killer);
}

PlayerUtil.setLastAttacker(dead, null);
Expand All @@ -525,6 +526,7 @@ public void onDeath(Player dead) {

PlayerUtil.doVelocityChange(dead);


// Handle visibility for match players
// Send death message
for (GameParticipant<MatchGamePlayer> gameParticipant : getParticipants()) {
Expand Down Expand Up @@ -590,7 +592,7 @@ public GameParticipant<MatchGamePlayer> getParticipantA() {
return getParticipants().get(0);
}

public void sendTeamAMessage(String message){
public void sendTeamAMessage(String message) {
for (GameParticipant<MatchGamePlayer> gameParticipant : getParticipants()) {
gameParticipant.sendMessage(message);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/lrxh/practice/match/MatchListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ public void onBlockBreakEvent(BlockBreakEvent event) {
return;
}

if(!aTeam){
if (!aTeam) {
match.sendTitleA("&cBED DESTROYED!", "&fYou will no longer respawn!", 40);
}else{
} else {
match.sendTitleB("&cBED DESTROYED!", "&fYou will no longer respawn!", 40);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ public boolean isOnSameTeam(Player first, Player second) {

@Override
public List<GameParticipant<MatchGamePlayer>> getParticipants() {
System.out.println("This getting ran");
return new ArrayList<>(participants);
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/me/lrxh/practice/match/task/MatchLogicTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import me.lrxh.practice.participant.GamePlayer;
import me.lrxh.practice.util.CC;
import me.lrxh.practice.util.PlayerUtil;
import org.bukkit.Sound;
import org.bukkit.scheduler.BukkitRunnable;

public class MatchLogicTask extends BukkitRunnable {
Expand Down Expand Up @@ -44,16 +45,19 @@ public void run() {
match.sendMessage(Locale.MATCH_STARTED.format());
match.sendMessage(" ");
match.sendMessage(Locale.MATCH_WARNING.format());

if (match.getKit().getGameRules().isSumo() || match.getKit().getGameRules().isBedwars()) {
for (GameParticipant<MatchGamePlayer> gameParticipant : match.getParticipants()) {
for (GamePlayer gamePlayer : gameParticipant.getPlayers()) {
PlayerUtil.allowMovement(gamePlayer.getPlayer());
}
}
}
match.sendSound(Sound.FIREWORK_BLAST, 1.0F, 1.0F);
} else {
match.sendMessage(Locale.MATCH_START_TIMER.format(nextAction, nextAction == 1 ? "" : "s"));
match.sendTitle(CC.translate("&e" + nextAction), "", 20);
match.sendSound(Sound.CLICK, 1.0F, 1.0F);
if (match.getKit().getGameRules().isBoxing()) {
for (GameParticipant<MatchGamePlayer> players : match.getParticipants()) {
players.addSpeed();
Expand Down

0 comments on commit 9c191aa

Please sign in to comment.