|
|
|
@ -33,6 +33,7 @@ public class TabHandler { |
|
|
|
String footerString = String.join("\n&r", footer); |
|
|
|
String footerString = String.join("\n&r", footer); |
|
|
|
tabDataList.add(headerString); |
|
|
|
tabDataList.add(headerString); |
|
|
|
tabDataList.add(footerString); |
|
|
|
tabDataList.add(footerString); |
|
|
|
|
|
|
|
Bukkit.getLogger().info((String) tabDataList.get(1)); |
|
|
|
tabData.put(targetKey + "." + key, tabDataList); |
|
|
|
tabData.put(targetKey + "." + key, tabDataList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -45,21 +46,23 @@ public class TabHandler { |
|
|
|
public static void chooseTab(Player player){ |
|
|
|
public static void chooseTab(Player player){ |
|
|
|
String choosenTab = "tabs.required.default"; |
|
|
|
String choosenTab = "tabs.required.default"; |
|
|
|
int choosenPriority = tabConfig.getInt("tabs.required.default.priority"); |
|
|
|
int choosenPriority = tabConfig.getInt("tabs.required.default.priority"); |
|
|
|
if (tabData.containsKey("tabs.player.players." + player.getDisplayName())){ |
|
|
|
if (tabData.containsKey("tabs.world.worlds." + player.getWorld().getName()) && tabConfig.getBoolean("tabs.world.enabled")){ |
|
|
|
player.sendMessage("ss"+choosenPriority); |
|
|
|
player.sendMessage(player.getWorld().getName()); |
|
|
|
|
|
|
|
if ((int)tabData.get("tabs.world.worlds." + player.getWorld().getName()).get(0) > choosenPriority){ |
|
|
|
|
|
|
|
choosenTab = "tabs.world.worlds." + player.getWorld().getName(); |
|
|
|
|
|
|
|
choosenPriority = (int)tabData.get("tabs.world.worlds." + player.getWorld().getName()).get(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (tabData.containsKey("tabs.player.players." + player.getDisplayName()) && tabConfig.getBoolean("tabs.player.enabled")){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((int)tabData.get("tabs.player.players." + player.getDisplayName()).get(0) > choosenPriority){ |
|
|
|
if ((int)tabData.get("tabs.player.players." + player.getDisplayName()).get(0) > choosenPriority){ |
|
|
|
player.sendMessage("SSSSSSSS"); |
|
|
|
|
|
|
|
choosenTab = "tabs.player.players." + player.getDisplayName(); |
|
|
|
choosenTab = "tabs.player.players." + player.getDisplayName(); |
|
|
|
choosenPriority = (int)tabData.get("tabs.player.players." + player.getDisplayName()).get(0); |
|
|
|
choosenPriority = (int)tabData.get("tabs.player.players." + player.getDisplayName()).get(0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (tabData.containsKey("tabs.world.worlds." + player.getWorld().getName())){ |
|
|
|
|
|
|
|
if ((int)tabData.get("tabs.world.worlds." + player.getWorld().getName()).get(0) > choosenPriority){ |
|
|
|
|
|
|
|
choosenTab = "tab.world.worlds." + player.getWorld().getName(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
playerTab.put(player, choosenTab); |
|
|
|
playerTab.put(player, choosenTab); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|