Skip to content

Commit

Permalink
Moved initial nametag refresh to join event because register event is…
Browse files Browse the repository at this point in the history
… called to early
  • Loading branch information
NIkiIncredible committed Jul 21, 2024
1 parent ee397a9 commit 834d12d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scoreboard.ScoreboardManager;
import org.bukkit.scoreboard.Team;

public class NametagManager {

public NametagManager() {
Spookly.getServer().getEventExecuter().register(PlayerRegisterEvent.class, event -> {
refreshNameTag(event.getSpooklyPlayer());
Spookly.getServer().getEventExecuter().register(PlayerJoinEvent.class, event -> {
SpooklyPlayer spPlayer = Spookly.getPlayer(event.getPlayer().getUniqueId());
if (spPlayer != null) {
refreshNameTag(spPlayer);
}
});
}

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'java'
id 'java-library'
id("io.freefair.lombok") version "8.6"
id "io.freefair.lombok" version "8.6"
// Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev
id "com.diffplug.spotless" version "6.20.0"
id("io.papermc.paperweight.userdev") version "1.7.1"
id "io.papermc.paperweight.userdev" version "1.7.1"
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'maven-publish'
}
Expand Down

0 comments on commit 834d12d

Please sign in to comment.