Skip to content

Commit

Permalink
Refactor remove method placement in PaperPlayerCharacter
Browse files Browse the repository at this point in the history
Reorganized the `remove` method to improve code structure and readability by moving it to a more appropriate location within the class. This change does not alter functionality but ensures better consistency and maintainability of the code.
  • Loading branch information
NonSwag committed Jan 19, 2025
1 parent c496f07 commit 9de78e9
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ public String getScoreboardName() {
return Objects.requireNonNull(profile.getName());
}

@Override
public void remove() {
plugin.getServer().getOnlinePlayers().forEach(player -> {
var team = player.getScoreboard().getTeam(getScoreboardName());
if (team != null) team.unregister();
});
super.remove();
}

@Override
public boolean setCollidable(boolean collidable) {
if (!super.setCollidable(collidable)) return false;
Expand Down Expand Up @@ -177,6 +168,15 @@ public boolean spawn(Location location) {
return true;
}

@Override
public void remove() {
plugin.getServer().getOnlinePlayers().forEach(player -> {
var team = player.getScoreboard().getTeam(getScoreboardName());
if (team != null) team.unregister();
});
super.remove();
}

@Override
protected void updateDisplayName(Player player) {
updateDisplayNameHologram(player);
Expand Down

0 comments on commit 9de78e9

Please sign in to comment.