Restructure commands #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It would be great to have a single class that listens to the [
onCommand](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/command/CommandExecutor.html#onCommand%28org.bukkit.command.CommandSender, org.bukkit.command.Command, java.lang.String, java.lang.String[]%29) event and then calls our internal command methods (instead of creating tons of listeners for each command).This would also allow us to throw our own error classes which we could catch, e.g:
NoPermissionErrorInvalidArgsErrorNotPlayerErrorThis would save us stuff like
instead we would do something like
New Event URL: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerCommandPreprocessEvent.html
There is no such CommandExecutor event btw?
BTW: Console won't be able to use commands if we use the event up there ^
there is, link fixed.
Well now its not an event, its a CommandHandler but yeah that'll do :P
I guess a command is still an event.
Wtf xD