Some feedback for my new plugin?

Discussion in 'Spigot Plugin Development' started by Remy2402, May 27, 2015.

  1. Hey I just released a new plugin which I thought would get a few downloads. It only has 1 download at the moment. Does anyone have some feedback for me? You can look at the code on the GitHub page linked on the resource page.
    http://www.spigotmc.org/resources/maintenanceplus.7498/
     
  2. Naming conventions
     
  3. What do you mean? Needs a different name?
     
    • Funny Funny x 2
  4. Cldfire

    Cldfire Retired Moderator
    Retired

    He was probably talking about class/variable names...
     
  5. Ahhhh. What changes should I make regarding those?
     
  6. Ok. Didn't need two of the same link. Anyway, so I guess package names should be changed a bit. I think everything else is right. What about features of the plugin?
     
  7. Static getInstance method....
     
  8. Oops. That's a habit. Will remove ;)
     
  9. You do not get downloads because you made a plugin for something that already exist. Is not hard to set whitelist to true, set another icon and motd. Try to make something that you can't do without plugin, then you will get downloads.
     
    • Agree Agree x 1
  10. Not a fan of singleton methods, also in the SettingsManager why is there a Plugin p that is never initialized? You are circling around just using plugin#getConfig(), by which you are instead putting it into the SettingsManager and requiring its use. saveConfig() and reloadConfig() are already methods in Bukkit... https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/Plugin.html

    Or am I wrong in something there?
     
  11. I realize this. But I am asking for some suggestions on more unique cool features I could add
     
  12. That is just someone else's settings manager that I like. It works so I am happy :)
     
  13. ...

    Yeah, I would honestly suggest against using others code and for experience sake code your own settings manager.
    In the onEnable you ignore your own settingsmanager and use bukkit methods, which is correct but shows that there is no real point in having superfluous methods in your code:
    [​IMG]

    Also that saveConfig() position bugs me more than it should; but that's just me I guess :p
     
  14. Yeah I prefer to use default config methods from bukkit. But data saving is easier with the SettingsManager. Also, that saveConfig(); positioning is weird. On my IDE it is in a normal position.
     
  15. @Puddanator
    • Don't use Bukkit.getLogger(), use JavaPlugin#getLogger().
    • You should use the appropiate access modifiers for your fields - the majority of them (in most projects) should be private.
    • Cache your fields! No need to read it from the config each time.
    • Like mentioned before, static abuse. You can simply pass the plugin instance ('this' in your main class) through the constructor of another class. (the singleton design pattern should not be used if better alternatives are available)
     
  16. Yes yes. Is there any new features I should add?
     
  17. Quality code takes priority over features.
     
  18. OMG. I know. I will be going through here and getting all the code feedback and fixing it soon but I want to add some new stuff as well. Does anyone have some suggestions on the current features or new features I should add.