Solved Plugin Outdated?

Discussion in 'Plugin Help/Development/Requests' started by FlobGaming, Dec 26, 2014.

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

    FlobGaming

    Hi everyone my name is Flob! I have recently created a plugin for my server called SurvivalTeams. It is a spin-off of the old McTeams plugin. I have tried to load it on my server and it came up with this error:

    Code:
    [20:16:52 INFO]: [SurvivalTeams] Enabling SurvivalTeams v1.0.1
    [20:16:52 ERROR]: Error occurred while enabling SurvivalTeams v1.0.1 (Is it up to date?)
    java.lang.NullPointerException
        at me.flobgaming.SurvivalTeams.Main.onEnable(Main.java:13) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:412) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugin(CraftServer.java:476) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.enablePlugins(CraftServer.java:394) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.n(MinecraftServer.java:360) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.g(MinecraftServer.java:334) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.a(MinecraftServer.java:290) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.DedicatedServer.init(DedicatedServer.java:210) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:458) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
        at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-207-g03373bb]
    As you can see it said "Error occurred while enabling SurvivalTeams v1.0.1 (Is it up to date?)" I do not know what this means because I am using the same version of Bukkit that I inserted into my project build path to run my server. This plugin does appear on my plugin list. Please tell me if you need to see my code and help would be much appreciated! Thanx!
     
    Last edited: Dec 26, 2014
  2. Offline

    teej107

  3. Offline

    FlobGaming

    I have read that thread, and it seems unclear to me. Although I have found an error in my code, it is the "getHealth()" method. This is what is says in eclipse: "The method getHealth() is ambiguous for the type Player." I do not know how to fix this error. I don't even know if its the error that causing this problem.
     
  4. Offline

    teej107

    ZodiacTheories and AdamQpzm like this.
  5. Offline

    Skionz

    @FlobGaming
     
    AdamQpzm and mythbusterma like this.
  6. Offline

    FlobGaming

    Thanks guys! I have looked at all of those threads and been able to fix the "getHealth()" problem by replacing the CraftBukkit build with the Bukkit build but I have just tested my plugin again and I still have the same error as before. This means the error in the code of my plugin had no effect on my plugin loading. Any suggestion guys?
     
  7. Offline

    mythbusterma

    @FlobGaming

    Well, it's pretty obvious there's a glaring error in your code at line 13 in "Main.java."
     
  8. Offline

    FlobGaming

    Thats weird @mythbusterma that error is not detected by Eclipse.
     
  9. Offline

    nverdier

    Why does an error need to be "detected by Eclipse"?
     
  10. Offline

    mythbusterma

    @FlobGaming

    Largely, Eclipse's built-in checking checks for syntax and very simple flaws in logic, other software (*cough* IntelliJ*cough*) has more intelligent checks that might have caught that, but that is besides the point. IDE's primarily check syntax and compile time errors, they don't detect flaws in your logic, that's simply not their purpose. Don't ever rely on your IDE for anything other organising files and syntax checking.

    I, personally, find a lot of Eclipse suggestions (for inexperienced programmers) encourage a lot of bad practises and generally hamper your code.
     
    ZodiacTheories, Skionz and teej107 like this.
  11. Offline

    teej107

  12. Offline

    FlobGaming

    I don't understand...
     
  13. Offline

    teej107

    @FlobGaming About what exactly? Did you read it thoroughly?
     
  14. Offline

    FlobGaming

    Yes but I don't know how to fix that line of code.
     
  15. Offline

    mythbusterma

  16. Offline

    teej107

  17. Offline

    RingOfStorms

    If you want any help with your error you will need to also post your main class, right now all we can tell you is to go learn how to read an error and fix it yourself.
     
  18. Offline

    FlobGaming

    @RingOfStorms here is my Main.java:

    Code:
    package me.flobgaming.SurvivalTeams;
    
    import org.bukkit.Server;
    import org.bukkit.command.PluginCommand;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin
    {
      FileManager fm = FileManager.getInstance();
    
      public void onEnable() {
        getCommand("team").setExecutor(new Command(this));
        this.fm.setup(this);
        getServer().getPluginManager().registerEvents(new ChatListener(this), this);
        getServer().getPluginManager().registerEvents(new JoinListener(), this);
        getServer().getPluginManager().registerEvents(new FriendlyFireListener(), this);
      }
    }
    
    Can I please have some help with fixing the code on line 13 like @mythbusterma said above?
     
  19. Offline

    teej107

    @RingOfStorms I honestly think he should learn how to fix it by himself. All the help he needs can be found in sticky threads.
     
  20. Offline

    FlobGaming

    I am new to Bukkit by the way.
     
  21. Offline

    mythbusterma

    ZodiacTheories and teej107 like this.
  22. Offline

    teej107

    @FlobGaming So. What does that have to do with anything? Still doesn't change that fact that I posted 2 links that can fix your problem. Now if you are new to Java, that is a totally different thing and in that case I'll say this:
    http://docs.oracle.com/javase/tutorial/
     
  23. Offline

    FlobGaming

    No you guys have it all wrong. I have a basic average of Java and Bukkit I'm just new to Bukkit Forums. I said that because @teej107 said something about "Sticky Forums". This error is for some reason stumping my mind...
     
  24. Offline

    mythbusterma

    @FlobGaming

    If you had an "average" understanding of Java, this error would be a very simple fix. This isn't unique to Bukkit, and frankly I think it's insulting to my profession that someone claims to have an "average" understanding of Java and can't figure out a NullPointerException.

    He didn't mention "sticky forums," he mentioned a "stickied thread," which is a thread that has been posted at the top of a forum so it will always be seen. In this case, he's referring to the one that says "How to debug your own stack traces," or something of that nature.
     
  25. Offline

    stoneminer02

    *cough* this line is the error: getCommand("team").setExecutor(new Command(this)); *cough*
     
  26. Offline

    ZodiacTheories

    @FlobGaming

    Read through your Command class, and read through line 13 of your main class.
     
  27. Offline

    FlobGaming

    Line 13 was
    Code:
    getCommand("team").setExecutor(new Command(this));
    I changed it to
    Code:
    this.getCommand("team").setExecutor(new Command(this));
    it seemed to have changed nothing help please?
     
  28. Offline

    teej107

    @FlobGaming What makes you think that would make a difference to begin with?
     
  29. Offline

    FlobGaming

    Well what else could I do to line 13 of my Main.java? I am really confused right now.
     
  30. Offline

    teej107

Thread Status:
Not open for further replies.

Share This Page