diff --git a/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/bootstrap/StaffBootstrapper.java b/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/bootstrap/StaffBootstrapper.java index c4f12f00..bf620c03 100644 --- a/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/bootstrap/StaffBootstrapper.java +++ b/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/bootstrap/StaffBootstrapper.java @@ -105,6 +105,7 @@ public void checkVersion() { if (jenkinsJob.lastCompletedBuild().number() > Constants.JENKINS_BUILD_NUMBER) { getLogger().warning("There is a new version available! You are %n versions behind.".replace("%n", String.valueOf(jenkinsJob.lastCompletedBuild().number() - Constants.JENKINS_BUILD_NUMBER))); getLogger().warning("You can download it from here: " + jenkinsJob.lastCompletedBuild().url()); + getLogger().warning("Or you can download it from here: https://modrinth.com/plugin/staff"); } }).exceptionally(throwable -> { getLogger().warning("Couldn't get the latest version from Jenkins."); diff --git a/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/util/transoformer/nametag/TabNameTagTransformer.java b/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/util/transoformer/nametag/TabNameTagTransformer.java index 88471e08..e1891d67 100644 --- a/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/util/transoformer/nametag/TabNameTagTransformer.java +++ b/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/util/transoformer/nametag/TabNameTagTransformer.java @@ -14,11 +14,9 @@ @Singleton public final class TabNameTagTransformer implements NameTagTransformer { - private final NameTagManager nameTagManager = TabAPI.getInstance().getNameTagManager(); - @Inject public TabNameTagTransformer(@NotNull final Logger logger) { - if (nameTagManager == null) { + if (getNameTagManager() == null) { logger.severe("TabAPI is not loaded, disabling TabNametagTransformer."); } } @@ -27,6 +25,7 @@ public TabNameTagTransformer(@NotNull final Logger logger) { public void setPrefix(@NotNull PlayerWrapper player, @NotNull String prefix) { requireNonNull(player, "Player cannot be null."); requireNonNull(prefix, "Prefix cannot be null."); + final var nameTagManager = getNameTagManager(); if (nameTagManager == null) return; nameTagManager.setPrefix(getTabPlayer(player), prefix); @@ -35,6 +34,7 @@ public void setPrefix(@NotNull PlayerWrapper player, @NotNull String prefix) { @Override public void removePrefix(@NotNull PlayerWrapper player) { requireNonNull(player, "Player cannot be null."); + final var nameTagManager = getNameTagManager(); if (nameTagManager == null) return; nameTagManager.setPrefix(getTabPlayer(player), null); @@ -43,6 +43,7 @@ public void removePrefix(@NotNull PlayerWrapper player) { @Override public void setSuffix(@NotNull PlayerWrapper player, @NotNull String suffix) { requireNonNull(player, "Player cannot be null."); + final var nameTagManager = getNameTagManager(); if (nameTagManager == null) return; nameTagManager.setSuffix(getTabPlayer(player), suffix); @@ -51,6 +52,7 @@ public void setSuffix(@NotNull PlayerWrapper player, @NotNull String suffix) { @Override public void removeSuffix(@NotNull PlayerWrapper player) { requireNonNull(player, "Player cannot be null."); + final var nameTagManager = getNameTagManager(); if (nameTagManager == null) return; nameTagManager.setSuffix(getTabPlayer(player), null); @@ -59,4 +61,8 @@ public void removeSuffix(@NotNull PlayerWrapper player) { private TabPlayer getTabPlayer(PlayerWrapper player) { return TabAPI.getInstance().getPlayer(player.getUniqueId()); } + + private NameTagManager getNameTagManager() { + return TabAPI.getInstance().getNameTagManager(); + } }