diff --git a/src/main/java/me/lrxh/practice/match/Match.java b/src/main/java/me/lrxh/practice/match/Match.java index d3adcea..9c10ad4 100644 --- a/src/main/java/me/lrxh/practice/match/Match.java +++ b/src/main/java/me/lrxh/practice/match/Match.java @@ -500,7 +500,7 @@ public void onDeath(Player dead) { PlayerUtil.animateDeath(dead); if (killer != null) { - PlayerUtil.sendTitle(dead, CC.translate("&cLOST!"), "&c" + killer.getName() + " &fwon the match!", 60); + PlayerUtil.sendTitle(dead, CC.translate("&cLOST!"), "&c" + killer.getName() + " &fwon the match!", 70); } // Don't continue if the player is already dead @@ -515,8 +515,7 @@ public void onDeath(Player dead) { if (killer != null) { Profile killerProfile = Profile.getByUuid(killer.getUniqueId()); killerProfile.getOptions().killEffect().execute(killer, dead.getLocation()); - PlayerUtil.setLastAttacker(killer, null); - PlayerUtil.sendTitle(killer, CC.translate("&aVICTORY!"), "&a" + killer.getName() + " &fwon the match!", 60); + PlayerUtil.sendTitle(killer, CC.translate("&aVICTORY!"), "&a" + killer.getName() + " &fwon the match!", 70); killer.playSound(killer.getLocation(), Sound.EXPLODE, 1.0f, 1.0f); } @@ -591,6 +590,12 @@ public GameParticipant getParticipantA() { return getParticipants().get(0); } + public void sendTeamAMessage(String message){ + for (GameParticipant gameParticipant : getParticipants()) { + gameParticipant.sendMessage(message); + } + } + public GameParticipant getParticipantB() { return getParticipants().get(1); } @@ -705,6 +710,14 @@ public void sendTitle(String header, String footer, int duration) { } } + public void sendTitleA(String header, String footer, int duration) { + getParticipantA().sendTitle(header, footer, duration); + } + + public void sendTitleB(String header, String footer, int duration) { + getParticipantB().sendTitle(header, footer, duration); + } + public void sendSound(Sound sound, float volume, float pitch) { for (GameParticipant gameParticipant : getParticipants()) { gameParticipant.sendSound(sound, volume, pitch); diff --git a/src/main/java/me/lrxh/practice/match/MatchListener.java b/src/main/java/me/lrxh/practice/match/MatchListener.java index fce160a..8a07655 100644 --- a/src/main/java/me/lrxh/practice/match/MatchListener.java +++ b/src/main/java/me/lrxh/practice/match/MatchListener.java @@ -192,6 +192,12 @@ public void onBlockBreakEvent(BlockBreakEvent event) { return; } + if(!aTeam){ + match.sendTitleA("&cBED DESTROYED!", "&fYou will no longer respawn!", 40); + }else{ + match.sendTitleB("&cBED DESTROYED!", "&fYou will no longer respawn!", 40); + } + match.sendSound(Sound.ORB_PICKUP, 1.0F, 1.0F); match.sendSound(Sound.WITHER_DEATH, 1.0F, 1.0F); match.broadcast(" "); diff --git a/src/main/java/me/lrxh/practice/match/task/MatchLogicTask.java b/src/main/java/me/lrxh/practice/match/task/MatchLogicTask.java index a01bccf..393282e 100644 --- a/src/main/java/me/lrxh/practice/match/task/MatchLogicTask.java +++ b/src/main/java/me/lrxh/practice/match/task/MatchLogicTask.java @@ -16,16 +16,10 @@ public class MatchLogicTask extends BukkitRunnable { private final Match match; @Setter - private int nextAction; + private int nextAction = 6; public MatchLogicTask(Match match) { this.match = match; - - if (match.getKit().getGameRules().isSumo()) { - nextAction = 4; - } else { - nextAction = 6; - } } diff --git a/src/main/java/me/lrxh/practice/participant/GameParticipant.java b/src/main/java/me/lrxh/practice/participant/GameParticipant.java index 5aada9b..60b4aa0 100644 --- a/src/main/java/me/lrxh/practice/participant/GameParticipant.java +++ b/src/main/java/me/lrxh/practice/participant/GameParticipant.java @@ -2,6 +2,7 @@ import lombok.Getter; import lombok.Setter; +import me.lrxh.practice.util.PlayerUtil; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; @@ -75,6 +76,14 @@ public void sendMessage(List messages) { } } + public void sendTitle(String header, String footer, int duration) { + for (GamePlayer gamePlayer : getPlayers()) { + if (!gamePlayer.isDisconnected()) { + PlayerUtil.sendTitle(gamePlayer.getPlayer(), header, footer, duration); + } + } + } + public void sendSound(Sound sound, float volume, float pitch) { for (GamePlayer gamePlayer : getPlayers()) { if (!gamePlayer.isDisconnected()) { @@ -99,6 +108,4 @@ public void addSpeed() { } } } - - } diff --git a/src/main/java/me/lrxh/practice/util/PlayerUtil.java b/src/main/java/me/lrxh/practice/util/PlayerUtil.java index f59a911..3679fbb 100644 --- a/src/main/java/me/lrxh/practice/util/PlayerUtil.java +++ b/src/main/java/me/lrxh/practice/util/PlayerUtil.java @@ -67,7 +67,7 @@ public Player getLastAttacker(Player victim) { } public static void sendTitle(Player player, String header, String footer, int duration) { - player.sendTitle(new Title(CC.translate(header), CC.translate(footer), 1, duration, 0)); + player.sendTitle(new Title(CC.translate(header), CC.translate(footer), 1, duration, 10)); } public ItemStack getPlayerHead(UUID playerUUID) {