Skip to content

Commit

Permalink
Fixed ActionBarAPI not working correctly '-'
Browse files Browse the repository at this point in the history
  • Loading branch information
EverNife committed Sep 7, 2024
1 parent 87a298b commit 2fba4cd
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

public class ActionBarAPI {

private static final boolean THIS_SERVER_SUPPORTS_ACTIONBAR;static {
THIS_SERVER_SUPPORTS_ACTIONBAR = MCVersion.isLowerEquals(MCVersion.v1_7_10) || FCBukkitUtil.isModLoaded("necrotempus");
private static final boolean THIS_SERVER_SUPPORTS_ACTIONBAR; static {
THIS_SERVER_SUPPORTS_ACTIONBAR = MCVersion.isHigher(MCVersion.v1_7_10) || FCBukkitUtil.isModLoaded("necrotempus");
}
private static Map<UUID, PlayerActionBarManager> PLAYER_ACTION_BAR_MAP = new HashMap<>();

Expand All @@ -22,7 +22,10 @@ public static void send(Player player, String message){
}

public static void send(Player player, ActionBarMessage actionBarMessage){
if (!THIS_SERVER_SUPPORTS_ACTIONBAR) return;//ActionBar is not present on 1_7_10, and we don't have NecroTempus
if (!THIS_SERVER_SUPPORTS_ACTIONBAR){
//This server is on 1.7.10, and we don't have NecroTempus
return;
}

PlayerActionBarManager playerActionBarManager = PLAYER_ACTION_BAR_MAP.get(player.getUniqueId());

Expand All @@ -35,7 +38,10 @@ public static void send(Player player, ActionBarMessage actionBarMessage){
}

public static void clear(Player player){
if (!THIS_SERVER_SUPPORTS_ACTIONBAR) return;//ActionBar is not present on 1_7_10, and we don't have NecroTempus
if (!THIS_SERVER_SUPPORTS_ACTIONBAR){
//This server is on 1.7.10, and we don't have NecroTempus
return;
}

PlayerActionBarManager playerActionBarManager = PLAYER_ACTION_BAR_MAP.get(player.getUniqueId());

Expand Down

0 comments on commit 2fba4cd

Please sign in to comment.