Plugin not working with >1 Player Online

Discussion in 'Plugin Development' started by TheRealBuckshot, Jan 28, 2014.

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

    TheRealBuckshot

    Hey Bukkit! I've spent a lot of time on my plugin, and when I decided to test it with some friends on my server (Works like a charm with just me), the plugin just bugs out. Here's my code: (Sorry, I like one class and it's long!)

    Does anyone know whats wrong? Thanks for the help if you can!
     
  2. Offline

    afistofirony

    TheRealBuckshot Could you provide more information about what is going on? It "just bug[ging] out" isn't a very specific description of what happens.

    Also, please, for your own good (and for that of everyone helping you), please change this 300+ line behemoth
    Code:
    if (number == 30) {
        for (Player all : getServer().getOnlinePlayers()) {
            BarAPI.setMessage(all, ChatColor.AQUA + "There is 30 seconds until start.");
        }
    }
     
    ...
     
    if (number == 1) {
        for (Player all : getServer().getOnlinePlayers()) {
            BarAPI.setMessage(all, ChatColor.AQUA + "There is 1 seconds until start.");
        }
    }
    into this:
    Code:
    for (Player all : getServer().getOnlinePlayers() {
        BarAPI.setMessage(all, ChatColor.AQUA + "There " + (number == 1 ? "is " + number + "second"
                         : "are " + number + "seconds") + " remaining.");
    }
     
Thread Status:
Not open for further replies.

Share This Page