From 3a9fa0c0f76141469a1026e5d0d3465e4871f5d2 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 22 Nov 2021 19:12:37 +0100 Subject: [PATCH] fixed item drps on death and gamebeddestroed --- .../java/rip/tilly/bedwars/listeners/game/DamageListener.java | 1 + .../java/rip/tilly/bedwars/listeners/game/GameEndListener.java | 1 + .../rip/tilly/bedwars/providers/tablist/TablistProvider.java | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/DamageListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/DamageListener.java index 857fd5d..db79824 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/DamageListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/DamageListener.java @@ -99,6 +99,7 @@ public class DamageListener implements Listener { playerData.setLastDamager(damager); double health = player.getHealth() - event.getFinalDamage(); if (health < 0) { + event.setCancelled(true); this.plugin.getServer().getPluginManager().callEvent(new PlayerKillEvent(player, damager)); } diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java index a09e373..09a5c93 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java @@ -33,6 +33,7 @@ public class GameEndListener implements Listener { PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(player.getUniqueId()); playerData.setLastDamager(null); playerData.setGameKills(0); + playerData.setGameBedsDestroyed(0); String winnerTitle = CC.translate("&aVICTORY!"); String losingTitle = CC.translate("&cDEFEAT!"); diff --git a/src/main/java/rip/tilly/bedwars/providers/tablist/TablistProvider.java b/src/main/java/rip/tilly/bedwars/providers/tablist/TablistProvider.java index 2e6adc1..db8a1b2 100644 --- a/src/main/java/rip/tilly/bedwars/providers/tablist/TablistProvider.java +++ b/src/main/java/rip/tilly/bedwars/providers/tablist/TablistProvider.java @@ -13,7 +13,6 @@ import rip.tilly.bedwars.BedWars; import rip.tilly.bedwars.playerdata.PlayerData; import rip.tilly.bedwars.utils.CC; -import java.text.DecimalFormat; import java.util.List; public class TablistProvider implements TabAdapter { @@ -58,7 +57,6 @@ public class TablistProvider implements TabAdapter { Property property = skin.getProperties().get("textures").stream().findFirst().orElse(null); PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(player.getUniqueId()); - DecimalFormat decimalFormat = new DecimalFormat("0.00"); lines.add(new TabEntry(3, 2, CC.translate("&d&lYour Profile")).setPing(-1).setSkin(new Skin(property.getValue(), property.getSignature()))); lines.add(new TabEntry(3, 3, CC.translate(" &fKills: &d" + playerData.getKills())).setPing(-1));