Update item stack with bungee server status?

Discussion in 'Plugin Development' started by voltywolty, Jan 20, 2024.

Thread Status:
Not open for further replies.
  1. Offline

    voltywolty

    I have a server plugin my game mode is dependent on. In my game mode plugin, I have a line called

    Code:
    ServerManager.setServerStatus(mapName + ", Starting Soon");
    that is called in the onEnable.

    My ServerManager is in my server plugin here:
    Code:
    public static void setServerStatus(String status) {
            serverStatus = status;
        }
    This then gets updated in an Item Stack in a listener every time the player left clicks:
    Code:
        private void openGameListInventory(Player player) {
            Inventory gameListInv = Bukkit.createInventory(null, 9, "Game List");
    
            ItemStack game = new ItemStack(Material.RED_CONCRETE);
            game.setDurability((short) 9);
            ItemMeta gameMeta = game.getItemMeta();
            gameMeta.setDisplayName(ServerManager.lobbyName);
    
            ArrayList<String> gameLore = new ArrayList<>();
            gameLore.add(ChatColor.YELLOW + "Players: " + ChatColor.GOLD + ServerManager.online);
            gameLore.add(ChatColor.WHITE + ServerManager.serverStatus);
            gameMeta.setLore(gameLore);
    
            game.setItemMeta(gameMeta);
    
            if (plugin.getServerManager().isServerOnline())
                gameListInv.setItem(0, game);
    
            player.openInventory(gameListInv);
        }
    However, it isn't updating the status. The status will just say "null" rather than what I put in DvZ. I'm not too sure what is causing this. Can anyone help?
     
  2. Offline

    timtower Administrator Administrator Moderator

    Locked
    Bungeecord requires offline mode
    Offline mode is not suppported by Bukkit
     
Thread Status:
Not open for further replies.

Share This Page