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

[Api] Expand Flag Api #8

Conversation

JustAHuman-xD
Copy link
Contributor

Description

Expands the flags api to allow for other plugins to hook in and add more command flags, the use case atm is testing blockstorage shenanigans which will use flags that wouldn't make sense to have in the plugin itself

Changes

  • Added player as the first parameter for CommandFlag#apply, the value being the player who executed the command
  • Changed CommandFlags#FLAG_TYPES to be private and modifiable
    • Added CommandFlags#getFlagTypes which returns an unmodifiable copy
  • Added CommandFlags#addFlagType which will register a type with the given parameters
  • Added javadocs to the api methods of CommandFlags

Copy link
Contributor

@J3fftw1 J3fftw1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be a use case of this

@JustAHuman-xD
Copy link
Contributor Author

What would be a use case of this

i put it in the desc

@JustAHuman-xD
Copy link
Contributor Author

but also if addons have special cases or ways that they can affect slimefun blocks they could hook in and add flags for them

@J3fftw1
Copy link
Contributor

J3fftw1 commented Apr 5, 2024

Ah I completely read over it. Have been at work all day did nothing since there isn’t anything to do so I’m quite slow. Looks good have you tested this and is it ready to go

@JustAHuman-xD
Copy link
Contributor Author

Ah I completely read over it. Have been at work all day did nothing since there isn’t anything to do so I’m quite slow. Looks good have you tested this and is it ready to go

I haven't tested it atm but i think its fine? If you want tho i can quickly local install it and try it with a plugin hooking in

@J3fftw1 J3fftw1 merged commit 0f8d510 into Slimefun-Addon-Community:main Apr 5, 2024
1 check passed
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.

2 participants