Server crash error do i use wrong bukkit update

Discussion in 'Plugin Development' started by ninja2003, Jul 25, 2014.

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

    ninja2003

    So i was making a plugin and i was gonig to get all the players online on the server and there was no error in code and in the console when i look i get the crash exception java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()Ljava/util/Collection; i am guessing it has to do with the craftbukkit version raftBukkit version git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.2) any ideas of why it is wrong?
     
  2. Offline

    Niknea

    ninja2003 Can you please copy/paste the ENTIRE stacktrace, along with your code?
     
  3. My first guess is that you didn't specify the main class of your plugin in the plugin.yml file properly but without the full stacktrace and code it's impossible to say.
     
  4. Offline

    ninja2003

    Stacktrace: java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()Ljava/util/Collection;
    at me.ninja.seetzcraft.core.task.AntiCampingTask.run(AntiCampingTask.java:45) ~[?:?]
    at org.bukkit.craftbukkit.v1_7_R3.scheduler.CraftTask.run(CraftTask.java:53) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.craftbukkit.v1_7_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:600) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Code:java
    1. @Override
    2. public void run() {
    3. //Check every player
    4. // this under is line 45
    5. for (Player player : Bukkit.getOnlinePlayers()) {
    6. // anything
    7. }
    8. }
    9.  

    the class implements Runnable
     
  5. Offline

    Niknea

    ninja2003 please use the latest version from dl.bukkit.org.
     
  6. Offline

    stormneo7

    I THINK (So don't quote me on this) that they changed .getOnlinePlayers() to Bukkit.getServer().getOnlinePlayers();
    Not 100% sure, but just saw this in a thread.
     
  7. Offline

    ninja2003

    Thanks alot it saved me probably 3 hours of headaches!
     
  8. Offline

    Niknea

    ninja2003 No problem :).

    stormneo7 That's incorrect, in an enhanced for loop, you aren't suppose to put the ";".
     
  9. Offline

    stormneo7

    My point was that they added a .getServer(). The ; was incorrect on my part, no idea why I put it there.
     
  10. Offline

    Niknea

    stormneo7 Bukkit.getServer() only effects a few methods, and I believe this method wouldn't be effected by it.
     
Thread Status:
Not open for further replies.

Share This Page