-
-
Save Dinnerbone/2a185a41dcddfb9abb67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatcher.registerCommand( | |
literal("scoreboard").then( | |
literal("players").then( | |
literal("reset").then( | |
argument("players", players()).then( | |
optional("objective", objective()) | |
).executes(SOME_COMMAND) | |
) | |
).then( | |
literal("list").then( | |
argument("players", players()) | |
).executes(SOME_COMMAND) | |
) | |
).then( | |
literal("objectives").then( | |
literal("list").executes(SOME_COMMAND) | |
).then( | |
literal("setdisplay").then( | |
argument("slot", enumValues(ScoreboardSlotTypes.class)).then( | |
argument("objective", objective()) | |
).executes(SOME_COMMAND) | |
) | |
) | |
) | |
); |
@CelticMinstrel Aaand, you're sure it's still pretty readable when there are maybe 20 options and another 30 arguments? There are already pretty decent libraries out there http://args4j.kohsuke.org/
Just hopin this command system is totally optional you you can use whatever implementation you like....
Why do you have this marked "Secret" if you're posting it on Twitter? Why not let people find it from here too? You could put a comment or something explaining the context.
Oh the horror… Why don't you just use LUA for user-created stuff, like lots of other mature projects does? Instead of this… this… spaghetti.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should implement the bukkit server commands like backup etc into it before worrying about a gui