Solved DELETE

Discussion in 'Spigot Plugin Development' started by TheBlackTeddy, May 9, 2017.

  1. DELETE
     
    #1 TheBlackTeddy, May 9, 2017
    Last edited: Jan 22, 2021
  2. IntelliJ has no context of what you mean by the main application. It assumes that you mean a Java console application, which uses a different entry point than Bukkit plugins. If it can't find that entry point, it'll assume it's invalid
     
  3. Can you screenshot the error? Does said main class have a 'public static void main(String[] args)' method?
     
  4. This is why standards such as maven were invented. I suggest mavenizing your project, then it will compile and build across multiple IDEs. Hell, it'll even compile and build on ci servers like Jenkins, or even from the command line with ease.
     
  5. I bet you compiled it wrong. Open your jar in your favorite compression tool (winrar, 7zip, ark, etc) and see if all your classes and plugin.yml are there. ;)
     
  6. I'm just making some quick assumptions based on the context of this conversation and past experiences of these types of conversations.

    If it indeed compiled fine, then you simply forgot to register your commands in plugin.yml (and/or setExecutor() in the main class if the commands are in different classes) and forgot to register any event listeners to the plugin manager....
     
  7. As billy said, go and make it maven.

    I struggle to export using the old way, so now I just have one POM I copy across from my plugins and change the dependencies that I need.
     
    • Agree Agree x 1
  8. Okay from following the conversation so far, I think what's going on is you've put a public static main method in your main class? If so, remove it. Your IDE does not need to know the main class of your plugin. That's for generating a manifest file which is something you should probably research but isn't relevant to making plugins. You basically just need to set it up to compile your code and your plugin.yml into a jar file so bukkit can access it, like this:

    1. File > click Project Structure
    2. Click Artifacts on the left
    3. Click the plus button, hover over JAR and click module with dependencies
    4. Hit ok (main class should be blank, no options changed)
    5. If you have your plugins.yml in a separate place from your src, click the plus button in the middle, click File, and find and click your plugin.yml
    Edit: 5.5. Also go to Modules in the left and make sure the spigot dependency is set to provided.
    6. Click apply and close out of the windows, back to the main Intellij window.
    7. Go to Build > Build Artifacts > Click Rebuild (or build) in the little popup in the menu
    8. You should now have a compiled jar in the out/artifacts/ directory which you can put in your plugins folder.

    Sorry if something here is wrong or inefficient or whatever, it's been quite a while since I started using Maven and I haven't looked back (seriously, consider it. it's so helpful)
     
  9. I also wanna say if you went with Maven, adding dependencies is honestly so easy.

    It's easy to add system dependencies too (ones that lie on your PC). Go get the POM file from my RankVouchers if you wish and edit accordingly.
     
    • Agree Agree x 1