Solved What is wrong with this beginning code?

Discussion in 'Plugin Help/Development/Requests' started by TECGaming360, Feb 7, 2015.

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

    TECGaming360

    Help there is something wrong with this coding. I've tried changing this around NOTHING.
    Code:
    @Override
        public void onEnable() {
             config = getConfig();
                config.options().copyDefaults(true);
                saveConfig();
                this.saveDefaultConfig();
                cFile = new File(getDataFolder(), "config.yml"); //Reload Exercise
                plugin = this;
                new PlayerListener(this); //java class file connection
                PluginManager pm = getServer().getPluginManager();
            getLogger().info(ANSI_YELLOW +"["+ ANSI_CYAN + "SimpleJoinMessage" + ANSI_YELLOW +"]" + ANSI_BLUE +" The plugin has been Enabled." + ANSI_BOLD + ANSI_RED + "You should not see any errors after this! If you do contact us with the Error Script! Thank You" + ANSI_RESET);
        }
        @Override
        public void onDisable() {
        }

    Most of the errors are the same for Example this.SaveDefultConfig() i got this error: The method saveDefaultConfig() is undefined for the type Main
     
  2. Offline

    pie_flavor

    @TECGaming360 This is a really stupid question, but does your Main class extend JavaPlugin?
     
  3. Offline

    Lactem

    @TECGaming360 There's no method called saveDefaultConfig() in JavaPlugin, but there is one called saveDefaultConfig(). (gotta watch the caps)
     
  4. Offline

    TECGaming360

    It wasent Extended i got it now thanks don't know how i missed that thanks. Now im stuck were im at and Lactem
    saveDefaultConfig()
    saveDefaultConfig()
    /\
    [​IMG]
     
    Last edited: Feb 8, 2015
  5. Offline

    Lactem

    Not trolling and possibly stupid. Your example is this.SaveDefultConfig(). I'm telling you that your example is incorrect, and this.saveDefaultConfig() is how you would fix that.
     
  6. Offline

    pie_flavor

    @Lactem Dude, if you look in his code example he has it spelled and capitalized correctly. He just screwed up a bit in the post-writing.
    @TECGaming360 Are you using an IDE for programming? If you aren't, I suggest Eclipse.
     
  7. Offline

    TGRHavoc

    @pie_flavor
    He is using an IDE as his OP states
    which you mainly get from an IDE (Unless notepad got an upgrade I don't know about :p)

    @TECGaming360
    Could you post the full code please, it'll help out a lot more than just a snippet.
     
  8. Offline

    pie_flavor

    @TGRHavoc Don't know where you're getting your information. If you just javac it, it'll give you specific errors about what you're trying to do. Try it yourself, I've compiled more than a few plugins that way when Eclipse flaked out.
     
  9. Offline

    TECGaming360

    Oh. Well sorry i didnt check my Example but in the coding Clip/copy it is correct!

    It was solved earlier i missed those 2 words extends JavaPlugin messed everything up. Its all good now!

    BTW Does anyone now when a Real Bukkit build of 1.8 Comes out?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
    Lactem likes this.
  10. Offline

    Lactem

  11. Offline

    pie_flavor

    @TECGaming360 Since Wolvereness's DMCA takedown request, Bukkit has kinda just "noped". It will stay 1.7.10 forever. However, Spigot has updated Bukkit to 1.8 and seems to be taking up the whole project.
     
Thread Status:
Not open for further replies.

Share This Page