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 command interfaces #29

Closed
wants to merge 3 commits into from
Closed

Conversation

MazeXD
Copy link

@MazeXD MazeXD commented Sep 9, 2014

Adding some interfaces for commands.

I am open to suggestions on this pull request.

/**
*
*/
public interface CommandSource {
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this interface do ?

Copy link
Author

Choose a reason for hiding this comment

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

It represents the source of the command. (e.g. Player or Console)

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm wouldn't it be better to use CommandSender as name? Like in NMS ?

Choose a reason for hiding this comment

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

I like CommandSource better, dont forget this is not a bukkit copy

@nikosgram
Copy link

Maybe CommandSource like sender for now.

When execute command, run like this:

public void execute(CommandSource cmd, String[] args){

}

@MazeXD
Copy link
Author

MazeXD commented Sep 9, 2014

@nikosgram13: What do you mean by "Maybe CommandSource like sender"?
Do you mean if it's the sender of the command? Then yes as it should represent
a player or the console.

@viveleroi
Copy link
Contributor

Zidane mentioned he was planning a more "meaty" command system and I think with sk's recent work on Intake, and sk's desire for a non-crappy permission system, I'm betting that they'll want to tackle this.

@Zidane
Copy link
Member

Zidane commented Sep 9, 2014

@botskonet

I'm leaving this solely up to @sk89q and @zml2008 .

@sk89q
Copy link
Contributor

sk89q commented Sep 9, 2014

Here's a link to Intake: https://github.com/sk89q/Intake

We'll have to discuss the equivalent to "CommandSender" though.

@lenis0012
Copy link

@sk89q Intake looks sexy

@viveleroi
Copy link
Contributor

I prefer CommandSource, which can represent a player/console/command block, and then the Player can implement some sort of Permissable-type class for handling permissions.

I like where intake is going, and I like the use of the annotation-based command registration. One feature that's critical to me, and the only reason I didn't look into intake further, is we should allow a parent command to still handle logic if the next argument doesn't match any of it's children, rather catching a thrown exception as a place to present the logic.

@IDragonfire
Copy link

duplicated by #31

@lenis0012
Copy link

@botskonet Agreed, like i mentioned in the first commit

@IDragonfire
Copy link

import java.util.List;

/**
*

Choose a reason for hiding this comment

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

Missing description

* @return List of command aliases
*/
List<String> getAliases();

Choose a reason for hiding this comment

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

Whitespace

@turt2live
Copy link

@MazeXD please identify how this PR is better/worse than #31 and why it should be pulled. Thanks!

@sk89q
Copy link
Contributor

sk89q commented Sep 16, 2014

I ended up writing the command interfaces myself, sorry!

See 8779e58.

@sk89q sk89q closed this Sep 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants