Skip to content

Commit

Permalink
Use damage instead of setHealth
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanceSD committed Jul 11, 2024
1 parent 3d66a71 commit 4ecda57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public final void applyPunishments(final PvPlayer player) {
Bukkit.getPluginManager().callEvent(event);
if (Settings.isKillOnLogout()) {
player.setPvpLogged(true);
p.setHealth(0);
p.damage(Float.MAX_VALUE);
player.setPvpLogged(false);
}
if (Settings.getFineAmount() != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void onPlayerLogoutTest() {

listener.onPlayerLogout(new PlayerQuitEvent(player, ""));
listener.onPlayerLogoutMonitor(new PlayerQuitEvent(player, ""));
verify(player, times(1)).setHealth(0);
verify(player, times(1)).damage(Float.MAX_VALUE);
assertFalse(pvPlayer.isInCombat());

assertEquals(1, ph.getPlayers().size()); // attacker and defender
Expand Down

0 comments on commit 4ecda57

Please sign in to comment.