Fix damage dealt

This commit is contained in:
William committed 2022-01-14 00:25:42 +00:00
1 parent 79bfe5a847
commit 2f167ff612
1 file changed
+6 -7
@@ -11,7 +11,6 @@ import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Statistic;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
@@ -31,7 +30,7 @@ public class TimedTeleport {
private final Player player;
private final Location initialLocation;
private final double initialHealth;
private final int initialPlayerDamageDealt;
private final int initialDamageDealt;
private final int warmupTime = HuskHomes.getSettings().getTeleportWarmupTime();
@@ -39,7 +38,7 @@ public class TimedTeleport {
this.player = player;
this.initialLocation = player.getLocation();
this.initialHealth = player.getHealth();
this.initialPlayerDamageDealt = player.getStatistic(Statistic.DAMAGE_DEALT, EntityType.PLAYER);
this.initialDamageDealt = player.getStatistic(Statistic.DAMAGE_DEALT);
this.targetType = targetType;
this.targetPoint = targetPoint;
@@ -51,7 +50,7 @@ public class TimedTeleport {
this.player = player;
this.initialLocation = player.getLocation();
this.initialHealth = player.getHealth();
this.initialPlayerDamageDealt = player.getStatistic(Statistic.DAMAGE_DEALT, EntityType.PLAYER);
this.initialDamageDealt = player.getStatistic(Statistic.DAMAGE_DEALT);
this.targetType = TargetType.RANDOM;
MessageManager.sendMessage(player, "teleporting_countdown_start", Integer.toString(this.warmupTime));
@@ -62,7 +61,7 @@ public class TimedTeleport {
this.player = player;
this.initialLocation = player.getLocation();
this.initialHealth = player.getHealth();
this.initialPlayerDamageDealt = player.getStatistic(Statistic.DAMAGE_DEALT, EntityType.PLAYER);
this.initialDamageDealt = player.getStatistic(Statistic.DAMAGE_DEALT);
this.targetType = TargetType.PLAYER;
this.targetPlayerName = targetPlayerName;
@@ -205,8 +204,8 @@ public class TimedTeleport {
// This returns if the player has damaged other players
public boolean hasDamagedPlayers(Player p) {
final int playerDamageDealt = p.getStatistic(Statistic.DAMAGE_DEALT, EntityType.PLAYER);
return playerDamageDealt > initialPlayerDamageDealt;
final int damageDealt = p.getStatistic(Statistic.DAMAGE_DEALT);
return damageDealt > initialDamageDealt;
}
public Player getPlayer() {