Skip to content

Add support for commands.yml aliases in command cooldowns #3744

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

Merged
merged 13 commits into from
Feb 20, 2021

Conversation

FrankHeijden
Copy link
Contributor

This happens for example with commands.yml, the aliases defined in there don't have a PluginCommand instance.

@FrankHeijden FrankHeijden force-pushed the fix/alias-command-cooldown branch from 2dce671 to 39f2f4f Compare October 26, 2020 02:11
@pop4959
Copy link
Member

pop4959 commented Oct 30, 2020

Took a look at this real quick but doesn't seem like it's working. Have you tested this? If so, can you provide any manual test cases you tried and their output?

@pop4959 pop4959 added the type: bugfix PRs that fix bugs in EssentialsX. label Oct 30, 2020
@FrankHeijden FrankHeijden force-pushed the fix/alias-command-cooldown branch from 39f2f4f to 60db00a Compare October 30, 2020 16:06
@FrankHeijden
Copy link
Contributor Author

FrankHeijden commented Oct 30, 2020

Took a look at this real quick but doesn't seem like it's working. Have you tested this? If so, can you provide any manual test cases you tried and their output?

It was working, however we had to explicitly define an extra cooldown for the alias as well in the essentials config.yml, resulting in separate cooldowns -- the commit I just pushed should resolve this, we will now extract the PluginCommand object(s) ("object(s)", since aliases can point to multiple commands), and handle them all.

This built was tested on paper 1.8.8, paper 1.16.3 and spigot 1.16.3.

@FrankHeijden FrankHeijden changed the title Fall back to command from PlayerPreProcessEvent in case PluginCommand is null Add support for commands.yml in PlayerPreProcessEvent Oct 30, 2020
@FrankHeijden FrankHeijden changed the title Add support for commands.yml in PlayerPreProcessEvent Add support for commands.yml in PlayerCommandPreProcessEvent Oct 30, 2020
@pop4959 pop4959 linked an issue Nov 22, 2020 that may be closed by this pull request
@Chew Chew added the status: needs manual rebase Needs a manual local rebase due to base changes (regardless of what GH says) label Nov 26, 2020
@JRoy
Copy link
Member

JRoy commented Dec 21, 2020

Hello, can you please rebase this pull request so we can merge it! Thanks!

@FrankHeijden FrankHeijden force-pushed the fix/alias-command-cooldown branch from e3aae13 to e637e66 Compare December 21, 2020 08:50
@FrankHeijden
Copy link
Contributor Author

Hello, can you please rebase this pull request so we can merge it! Thanks!

Alright! Should be good to go now! Sorry I didn't notice it earlier, totally slipped my mind.

@Chew Chew removed the status: needs manual rebase Needs a manual local rebase due to base changes (regardless of what GH says) label Dec 22, 2020
- Split the provider up for both spigot/paper impl.
@FrankHeijden FrankHeijden force-pushed the fix/alias-command-cooldown branch from 1a8d3dc to b6c5cc3 Compare January 4, 2021 18:24
# Conflicts:
#	providers/PaperProvider/build.gradle
# Conflicts:
#	providers/PaperProvider/build.gradle
@FrankHeijden FrankHeijden requested a review from JRoy January 23, 2021 17:28
# Conflicts:
#	Essentials/src/main/java/com/earth2me/essentials/Essentials.java
@FrankHeijden FrankHeijden force-pushed the fix/alias-command-cooldown branch from 0e65970 to cd4007b Compare January 24, 2021 21:19
mdcfe
mdcfe previously approved these changes Feb 5, 2021
Removing PaperReflFormattedCommandAliasProvider.java and the need for the reflection library in paper providers.
@FrankHeijden
Copy link
Contributor Author

Done, should be good to go 😄

Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

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

looks fine to me, want @mdcfe to look one last time

@mdcfe mdcfe changed the title Add support for commands.yml in PlayerCommandPreProcessEvent Add support for commands.yml aliases in command cooldowns Feb 20, 2021
@mdcfe mdcfe enabled auto-merge (squash) February 20, 2021 16:28
@mdcfe mdcfe added this to the 2.19.0 milestone Feb 20, 2021
@mdcfe mdcfe merged commit f806409 into EssentialsX:2.x Feb 20, 2021
ressidell pushed a commit to ressidell/Essentials that referenced this pull request Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bugfix PRs that fix bugs in EssentialsX.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Requesting Alias's for TPR Command cooldowns do not work when aliases are set in commands.yml
6 participants