sVoxelDev / spigot-plugin-template

Quickstart template to create new Spigot Minecraft plugins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin.yml not generating

Cruxial0 opened this issue ยท comments

First of all, great work on this template, it really is a life saver.
I initially spendt over 3 days trying to get gradle set up, but I always seemed to run into errors.
Now everything seems to be working fine for the most part, but I seem to be missing 'plugin.yml' in the jar.
I have very little experience with gradle, if that wasn't immediately obvious, so I'm not really sure how to fix this myself.

I followed the Quickstart guide, step by step.
All my project does is listen to events, and send info regarding those events to an external API.

Here is the stacktrace:

java.lang.IllegalArgumentException: The embedded resource 'config.yml' cannot be found in plugins\CruxStatListener-4.2.2.jar
        at org.bukkit.plugin.java.JavaPlugin.saveResource(JavaPlugin.java:193) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.plugin.java.JavaPlugin.saveDefaultConfig(JavaPlugin.java:180) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at crux.dev.cruxstatlisteners.CruxStatsListener.onEnable(CruxStatsListener.java:38) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:520) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:434) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.reload(CraftServer.java:909) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.Bukkit.reload(Bukkit.java:697) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:790) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchServerCommand(CraftServer.java:775) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at net.minecraft.server.dedicated.DedicatedServer.handleCommandQueue(DedicatedServer.java:475) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:439) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1217) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1050) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[spigot-1.17.1.jar:3258-Spigot-dc75aca-960f310]
        at java.lang.Thread.run(Thread.java:833) [?:?] 

There seems to be a problem after renaming the package. You can try running the gradle clean task and then the build task. That should fix the issue.

I ran th clean script, but now when I build, the tests are failing with 0% succession.

Stack trace

Try reimporting the gradle project or run the generate spigot description task from the spigradle category.

Tried your suggestions, neither worked. Also tried generating a fresh project, which also did not work.
Still same error/stack trace as before.

Ah I looked at the stacktrace again. It seems you are trying to access a config.yml without having one. Try creating it in the resources folder.

Oh yeah, that seems to work. I didn't even have a resource folder generated. Not sure if the preset is supposed to do that or not, but thanks alot for the help regardless!

Good point. I will add an example config.yml to the template.

๐ŸŽ‰ This issue has been resolved in version 4.3.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€