This commit is contained in:
Maxlego08 2021-01-29 10:57:51 +01:00
parent 13ac38aa1c
commit 8b65f7eafb
4 changed files with 17 additions and 5 deletions

View File

@ -1,7 +1,7 @@
name: zKoth
author: Maxlego08
main: fr.maxlego08.zkoth.ZKothPlugin
version: 2.0.0.5
version: 2.0.0.6
softdepend: [PlaceholderAPI, Guilds, Factions, FactionsX, SuperiorSkyblock2, LegacyFactions, FeatherBoard, TAB, TitleManager]
commands:
api-version: 1.13

View File

@ -14,6 +14,7 @@ import fr.maxlego08.zkoth.scoreboard.implementations.FeatherBoardHook;
import fr.maxlego08.zkoth.scoreboard.implementations.TabPremiumHook;
import fr.maxlego08.zkoth.scoreboard.implementations.TitleManagerHook;
import fr.maxlego08.zkoth.zcore.ZPlugin;
import fr.maxlego08.zkoth.zcore.logger.Logger;
import fr.maxlego08.zkoth.zcore.utils.plugins.Metrics;
import fr.maxlego08.zkoth.zcore.utils.plugins.Plugins;
@ -60,12 +61,20 @@ public class ZKothPlugin extends ZPlugin {
if (this.isEnable(Plugins.FEATHERBOARD)) {
this.scoreboardManager.setScoreboard(new FeatherBoardHook());
} else if (this.isEnable(Plugins.TAB)) {
this.scoreboardManager.setScoreboard(new TabPremiumHook());
} else if (this.isEnable(Plugins.TITLEMANAGER)) {
}
try {
if (this.isEnable(Plugins.TAB) && Class.forName("me/neznamy/tab/api/TABAPI") != null) {
this.scoreboardManager.setScoreboard(new TabPremiumHook());
}
} catch (ClassNotFoundException e) {
}
if (this.isEnable(Plugins.TITLEMANAGER)) {
this.scoreboardManager.setScoreboard(new TitleManagerHook());
}
this.scoreboardManager.setDefaultScoreboard();
Logger.info("Load " + this.scoreboardManager.getScoreboard().getClass().getName() + " scoreboard manager");
getSavers().forEach(saver -> saver.load(getPersist()));

View File

@ -240,5 +240,9 @@ public class ScoreBoardManager extends ZUtils {
};
}
}
public Scoreboard getScoreboard() {
return scoreboard;
}
}

View File

@ -15,7 +15,6 @@ public class TabPremiumHook implements Scoreboard {
@Override
public void toggle(Player player, Consumer<Player> after) {
TabPlayer tabPlayer = TABAPI.getPlayer(player.getUniqueId());
System.out.println(tabPlayer);
if (tabPlayer != null && !tabPlayer.isScoreboardVisible())
tabPlayer.toggleScoreboard(false);
}