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

Disallow calling JavaPlugin#getCommand during onEnable for Paper plugins #11914

Merged
merged 3 commits into from
Jan 11, 2025

Conversation

NoahvdAa
Copy link
Member

@NoahvdAa NoahvdAa commented Jan 5, 2025

Every other day someone in #paper-dev tries to declare commands in paper-plugin.yml and use JavaPlugin#getCommand, which is not supported, but simply returns null instead of a clear error message.
This commit hopes to clarify that calling getCommand on self is not supported for paper plugins.

Note: check only applies during onEnable because we do not want to break the ability for other plugins to check if a plugin defines a command by calling JavaPlugin#getCommand on it

Every other day someone in #paper-dev tries to declare commands in paper-plugin.yml, which is not supported, but simply returns null instead of a clear error message.

This commit hopes to clarify that calling getCommand on self is not supported for paper plugins.

Note: check only applies during onEnable because we do not want to break the ability for other plugins to check if a plugin defines a command by calling JavaPlugin#getCommand on it
@NoahvdAa NoahvdAa requested a review from a team as a code owner January 5, 2025 13:50
@Leguan16
Copy link
Contributor

Leguan16 commented Jan 5, 2025

related to #10588

@NoahvdAa NoahvdAa requested a review from Machine-Maker January 5, 2025 19:25
@lynxplay lynxplay added the type: feature Request for a new Feature. label Jan 7, 2025
@lynxplay lynxplay merged commit ed75b0e into PaperMC:main Jan 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Request for a new Feature.
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

4 participants