Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Add support for wildcards #9

Open
Carlgo11 opened this issue Dec 6, 2013 · 9 comments · May be fixed by #12
Open

Add support for wildcards #9

Carlgo11 opened this issue Dec 6, 2013 · 9 comments · May be fixed by #12
Assignees
Milestone

Comments

@Carlgo11
Copy link
Member

Carlgo11 commented Dec 6, 2013

Add support for wildcards (*) in the cmd<number:, console & player: strings in the config.yml

@ghost ghost assigned fpigerre Dec 6, 2013
@fpigerre
Copy link
Member

fpigerre commented Dec 6, 2013

Aye aye Cap'n!

@Carlgo11
Copy link
Member Author

Carlgo11 commented Feb 9, 2014

@PSGS BUMP 🔔

@fpigerre
Copy link
Member

What do you mean by "Add support for wildcards"?

@Carlgo11
Copy link
Member Author

Add support for people to do: cmd1: a_command *
And the * would be all the arguments.

could also be used like this: cmd1: * arg1 arg2 arg3

@fpigerre
Copy link
Member

I see. Thanks :)

@fpigerre
Copy link
Member

In CommandListener.java, e.getMessage().equalsIgnoreCase("/" + plugin.getConfig().getString("cmd" + a)) should check the whole command message, including arguments, as the event being handled is PlayerCommandPreprocessEvent. Bukkit.getServer().dispatchCommand(Bukkit.getPlayer(e.getPlayer().getName()), replaceinput2); should also dispatch the whole command from a string, as if it was a raw command entered by a player.

Is getConfig().getStringList("player" + a).get(i).toString(); the reason why extra arguments can't be entered? I don't see where I need to add support for wildcards.

@Carlgo11
Copy link
Member Author

How do you think they'll be able to act on every possible argument to a command like /ban for example?
/ban psgs /ban Notch /ban carlgo11 /ban Koala
They would need to add a cmd for every possible command. At least that's how they'd have to do atm. There for we need wildcards :P

@Carlgo11
Copy link
Member Author

We need to convert wildcards from the cmd string in the config. Not the in game command.

@fpigerre
Copy link
Member

Oh, wow. I made a huge mistake...

@fpigerre fpigerre linked a pull request Feb 18, 2014 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants