Skip to content

New event. CommandProcessEvent#888

Closed
djxy wants to merge 5 commits intoSpongePowered:bleedingfrom
djxy:feature/CommandProcessEvent
Closed

New event. CommandProcessEvent#888
djxy wants to merge 5 commits intoSpongePowered:bleedingfrom
djxy:feature/CommandProcessEvent

Conversation

@djxy
Copy link
Copy Markdown

@djxy djxy commented Aug 20, 2016

I needed an event to handle the process of a command before and after that happen in the same tick. So I created this new event to handle that.

When some commands are fired by some players, I need to disable some functionalities. /help is one of them.

Currently there is only one event for when a command is send and it is SendCommandEvent. The commandResult isn't good.

https://github.com/SpongePowered/SpongeCommon/blob/bleeding/src/main/java/org/spongepowered/common/command/SpongeCommandManager.java#L258

SpongeAPI: SpongePowered/SpongeAPI#1333

import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.InvocationCommandException;
import org.spongepowered.api.command.*;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No star imports please

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

My bad, Intellij Idea did it automatically. I will change that.

@zml2008
Copy link
Copy Markdown
Member

zml2008 commented Aug 20, 2016

I don't see any reason to have SendCommandEvent and CommandProcessEvent.Pre be separate -- their functionality is close enough that you should be able to combine them

@djxy
Copy link
Copy Markdown
Author

djxy commented Aug 20, 2016

Yes, I talked with @ryantheleach and we thought their functionalities were close. I will combine them.

@djxy
Copy link
Copy Markdown
Author

djxy commented Aug 20, 2016

I removed SendCommandEvent and I replaced it by CommandProcessEvent.Pre

@djxy djxy closed this Sep 22, 2016
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.

3 participants