diff --git a/src/main/java/net/thenextlvl/character/plugin/character/PaperPlayerCharacter.java b/src/main/java/net/thenextlvl/character/plugin/character/PaperPlayerCharacter.java index d34ae97..fbe1a57 100644 --- a/src/main/java/net/thenextlvl/character/plugin/character/PaperPlayerCharacter.java +++ b/src/main/java/net/thenextlvl/character/plugin/character/PaperPlayerCharacter.java @@ -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; @@ -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);