Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basis of command-support for Paper plugins #42

Closed
wants to merge 6 commits into from

Conversation

NicoStraube
Copy link

@NicoStraube NicoStraube commented Aug 1, 2023

  • Some parts of the code were rearranged or removed to reduce the amount of duplications and the size of the plugin.
  • I combined the code that validates the commands into one extension to also reduce the number of duplicates and the size of the plugin.

- Some parts of the code were rearranged or removed to reduce the amount duplications and the size of the plugin.
- Combine the code that validates the commands into one extension to also reduce the number of duplicates and the size of the plugin.
Add command example to the Paper section.
Add command example to the Paper section.
@stephan-gh
Copy link
Member

Thanks for working on this! I'm a bit confused though: As far as I understood, commands is intentionally not supported in paper-plugin.yml (see PaperMC/Paper#8859 (comment)). Has this changed? If yes, can you point to the change in Paper that adds support for reading commands from paper-plugin.yml? I didn't find anything related on a quick look.

@NicoStraube
Copy link
Author

NicoStraube commented Aug 1, 2023

Hi! I'm not exactly up-to-date about the command system in the newest version, but yes, you seem to be right.
My thought on why I wanted to implement this was the point that if you use paper {} you can't access the legacy command feature from bukkit. For people not knowing enough about the latest changes in the Paper API this would be useful, as far as I thought...
For me, this would be useful because at the moment my plugins rely on the legacy system. And because the paper-plugin.yml is just a drop in replacement for the plugin.yml I don't think that the `commands feuture will be removed any time soon so this would be a nice to have.

Edit: Got this information from the Wiki (https://docs.papermc.io/paper/dev/getting-started/paper-plugins):
Similarly to Bukkit plugins, you have to introduce a paper-plugin.yml file into your jar resources folder. This can act as a drop in replacement for plugin.yml, allowing you to specifically target the Paper platform. It should be noted you still have the ability to include both paper-plugin.ymland plugin.yml in the same jar.

@stephan-gh
Copy link
Member

I think that paper-plugin.yml is a drop in replacement for plugin.yml only in the sense that it serves the same purpose. This doesn't mean that everything from plugin.yml is supported exactly the same way with paper-plugin.yml. The format is actually (intentionally) different in some aspects, e.g. the dependencies.

As far as I can tell there is not any code in Paper that would parse the commands from the paper-plugin.yml (I looked mostly around https://github.com/PaperMC/Paper/blob/master/patches/server/0013-Paper-Plugins.patch#L4768 where most of the paper-plugin.yml parsing happens). Please check if adding commands in paper-plugin.yml really makes any noticeable difference, or maybe ask in the Paper chat if this is supported.

If your plugins rely on the legacy command system it might be easier if you stick to plugin.yml for now. This is still supported just fine when using Paper. paper-plugin.yml is still experimental AFAIK and only meant for plugins that really can and want to make use of the new functionality.

@NicoStraube
Copy link
Author

So - I've talked a bit with some people from Paper. The plan is pretty much like you said it would be. The implementation of the commands should be completely in the code-basis, not in the yml's anymore, so you're right and my "comfort-solution" is now unfortunately obsolete. 🥲
But thank you for your time, was still interesting to look at a Gradle plugin for the first time, lol. Good idea, but I would still adapt a few things - especially since there are an extremely large number of duplicates and, despite the same functionality or the same result, are designed differently in the real function.

@NicoStraube NicoStraube closed this Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants