From bfdd2460ab02d21330459c33df85f43b2be188d9 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 22 Nov 2021 16:58:32 +0100 Subject: [PATCH 1/2] :D --- .../bedwars/listeners/game/MovementListener.java | 14 ++++++++------ .../bedwars/managers/queue/QueueManager.java | 4 ++-- .../providers/scoreboard/ScoreboardProvider.java | 15 ++++++++------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/MovementListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/MovementListener.java index 00d9498..453941f 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/MovementListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/MovementListener.java @@ -56,12 +56,14 @@ public class MovementListener implements Listener { } } - if (from.getBlockY() <= game.getArena().getDeadZone() && game.getGameState() != GameState.ENDING && playerData.getPlayerState() != PlayerState.RESPAWNING) { - Player killer = playerData.getLastDamager(); - if (killer != null) { - this.plugin.getServer().getPluginManager().callEvent(new PlayerKillEvent(player, killer)); - } else { - this.plugin.getServer().getPluginManager().callEvent(new PlayerKillEvent(player, null)); + if (playerData.getPlayerState() != PlayerState.RESPAWNING && game.getGameState() != GameState.ENDING) { + if (player.getLocation().getY() <= game.getArena().getDeadZone()) { + Player killer = playerData.getLastDamager(); + if (killer != null) { + this.plugin.getServer().getPluginManager().callEvent(new PlayerKillEvent(player, killer)); + } else { + this.plugin.getServer().getPluginManager().callEvent(new PlayerKillEvent(player, null)); + } } } } diff --git a/src/main/java/rip/tilly/bedwars/managers/queue/QueueManager.java b/src/main/java/rip/tilly/bedwars/managers/queue/QueueManager.java index 6011e5e..a85f764 100644 --- a/src/main/java/rip/tilly/bedwars/managers/queue/QueueManager.java +++ b/src/main/java/rip/tilly/bedwars/managers/queue/QueueManager.java @@ -98,14 +98,14 @@ public class QueueManager { player.sendMessage(" "); player.sendMessage(CC.translate("&aGame found!")); player.sendMessage(CC.translate("&7⚫ &fOpponent: &d" + opponentPlayer.getName())); - //player.sendMessage(CC.translate("&7⚫ &fArena: &d" + arena.getName())); + player.sendMessage(CC.translate("&7⚫ &fArena: &d" + arena.getName())); player.sendMessage(CC.translate("&7⚫ &fGame: &d" + gameType.getName())); player.sendMessage(" "); opponentPlayer.sendMessage(" "); opponentPlayer.sendMessage(CC.translate("&aGame found!")); opponentPlayer.sendMessage(CC.translate("&7⚫ &fOpponent: &d" + player.getName())); - //opponentPlayer.sendMessage(CC.translate("&7⚫ &fArena: &d" + arena.getName())); + opponentPlayer.sendMessage(CC.translate("&7⚫ &fArena: &d" + arena.getName())); opponentPlayer.sendMessage(CC.translate("&7⚫ &fGame: &d" + gameType.getName())); opponentPlayer.sendMessage(" "); diff --git a/src/main/java/rip/tilly/bedwars/providers/scoreboard/ScoreboardProvider.java b/src/main/java/rip/tilly/bedwars/providers/scoreboard/ScoreboardProvider.java index f50d2cc..98fe575 100644 --- a/src/main/java/rip/tilly/bedwars/providers/scoreboard/ScoreboardProvider.java +++ b/src/main/java/rip/tilly/bedwars/providers/scoreboard/ScoreboardProvider.java @@ -76,6 +76,7 @@ public class ScoreboardProvider implements AssembleAdapter { lines.add("&fOnline: &d" + this.main.getServer().getOnlinePlayers().size()); lines.add("&fPlaying: &d" + this.main.getGameManager().getPlaying()); + lines.add("&fQueueing: &d" + this.main.getQueueManager().getAllQueueSize()); lines.add(" "); @@ -114,22 +115,22 @@ public class ScoreboardProvider implements AssembleAdapter { lines.add("&fDuration: &d" + game.getDuration()); lines.add(" "); if (yourTeam.isHasBed()) { - lines.add("&f[" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&f] &a&l✓ &7(YOU)"); + lines.add("&f7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &a&l✓ &7(You)"); } else if (yourTeam.getPlayingPlayers().size() > 0) { - lines.add("&f[" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&f] &7" + yourTeam.getPlayingPlayers().size() + " &7(YOU)"); + lines.add("&f7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &f" + yourTeam.getPlayingPlayers().size() + " &7(YOU)"); } else { - lines.add("&f[" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&f] &c&l✗ &7(YOU)"); + lines.add("&f7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &c&l✗ &7(You)"); } if (opposingTeam.isHasBed()) { - lines.add("&f[" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&f] &a&l✓"); + lines.add("&f7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &a&l✓"); } else if (opposingTeam.getPlayingPlayers().size() > 0) { - lines.add("&f[" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&f] &7" + yourTeam.getPlayingPlayers().size()); + lines.add("&f7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &f" + yourTeam.getPlayingPlayers().size()); } else { - lines.add("&f[" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&f] &c&l✗"); + lines.add("&f7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &c&l✗"); } lines.add(" "); lines.add("&fKills: &d" + playerData.getGameKills()); - lines.add("&fBeds Destroyed: &d"); + lines.add("&fBeds Destroyed: &d" + playerData.getGameBedsDestroyed()); lines.add(" "); lines.add("&dtilly.rip"); lines.add(CC.scoreboardBar); From 86413e60a004a31f3ab71af1c0942c73352cee05 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 22 Nov 2021 17:04:07 +0100 Subject: [PATCH 2/2] Update RespawnRunnable.java --- .../java/rip/tilly/bedwars/runnables/RespawnRunnable.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/rip/tilly/bedwars/runnables/RespawnRunnable.java b/src/main/java/rip/tilly/bedwars/runnables/RespawnRunnable.java index 4505c67..ef49f70 100644 --- a/src/main/java/rip/tilly/bedwars/runnables/RespawnRunnable.java +++ b/src/main/java/rip/tilly/bedwars/runnables/RespawnRunnable.java @@ -31,6 +31,10 @@ public class RespawnRunnable extends BukkitRunnable { cancel(); return; } + if (this.playerData.getPlayerState() != PlayerState.RESPAWNING || this.playerData.getPlayerState() != PlayerState.PLAYING) { + cancel(); + return; + } if (this.respawnTime <= 1) { this.playerData.setPlayerState(PlayerState.PLAYING);