-
-
Notifications
You must be signed in to change notification settings - Fork 67
New argument checklist
DerEchtePilz edited this page Apr 23, 2023
·
9 revisions
Here's the list of things that have to be done when adding a new argument MyArgument
to the CommandAPI:
- Add the relevant methods in NMS
- Add the relevant implementations of the argument in the relevant NMS implementations (e.g. NMS 1.13, NMS Common etc.)
- Add the argument to the annotation processor (with file name
AMyArgument.java
) - Add the entry to the
CommandAPIArgumentType
enum - Add Java examples for the documentation to
Examples.java
- Add Kotlin examples for the documentation to
Examples.kt
- Add Kotlin DSL examples for the documentation to
ExamplesKotlinDSL.kt
- Add the argument to the Kotlin DSL:
-
CommandTreeDSL.kt
- Make sure to add an entry to
CommandTree.myArgument
- Make sure to add an entry to
ArgumentTree.myArgument
- Make sure to add an entry to
-
CommandAPICommandDSL.kt
- Make sure to add an entry to
CommandAPICommand.myArgument
- Make sure to add an entry to
- Ensure all possible constructors are present in the Kotlin DSL. For example, the
IntegerArgument
has three constructors which are implemented by setting default values:This would be implemented like this:IntegerArgument(String) IntegerArgument(String, Integer) IntegerArgument(String, Integer, Integer)
integerArgument(nodeName: String, min: Int = Int.MIN_VALUE, max: Int = Int.MAX_VALUE, /* the rest of the parameters */) /* the remaining implementation */
-
- Write the documentation for the argument
- Add a new page for the argument
- Add the argument cast type to the argument casting page
- Add an entry to
ArgumentTests
testing the argument. See argument testing for more information on how to do that