Core Plugin

Discussion in 'Spigot Plugin Development' started by GB_6, Apr 18, 2017.

  1. I need some opinions on this. Would creating a core plugin that includes thing like 3x3 Mining, autosell chest and sell wand. Be beneficial to the server or would leaving them as standalone Plugins better?

    Also what should be in a core plugin?
     
  2. Standalone plugins are usually preferable for unrelated tasks because modularity is good, but if it's just for your own use, you can do them in a single plugin if you want.
     
  3. Its just that theres alot of small plugins all using nearly identical classes except for one or two. Wouldn't it improve performance when they are combined?
     
  4. @GB_6 I don't think it would degrade performance significantly, especially if they are small plugins. But the best practice would probably be to split the common code off into a core plugin or library that all the small, seemingly unrelated plugins will include in their dependencies. That way, server owners who want to use your plugins can pick and choose which features they want, and you also don't have to write the code twice.
     
    • Useful Useful x 1

  5. Good thinking +1 (more text necessary)
     
  6. I'd say separate plugins but if you're willing to make it a core I'd love to buy it.
     
  7. maldahleh

    Wiki Team

    Your best bet is to have a common library for the shared code, then separate plugins for each component. As mentioned above the main pro with a common library is not having to repeat your code twice, and that's because not only does it make your code bulky and messy but it makes it easier to fix an issue, if you find a bug you only have to fix it once and it reflects across all plugins using the library.