Commit 3a9a00a
Alexander Söderberg
feature: move argument requirement out of CommandArgument
This moves `required` and `defaultValue` out of CommandArgument, into CommandComponent. This reduces the verbosity of the command arguments by no longer forcing multiple static methods to determine whether the argument is required.
Whether an argument is required is now specified when adding the argument to the command. The previous `argument` methods on the command builder have been replaced by `required`/`optional` methods with many different overloads. We no longer have the ability to pass typed default values to the arguments as the command arguments no longer store the default values. We will have to think of a suitable replacement.
To facilitate this movement of data we've had to replace many references to CommandArgument with CommandComponent. To make this easier the CommandTree.Node class has been made less generic and has also been renamed to CommandTree.CommandNode.
Many deprecated methods have been removed as there is no real point in updating them as we'll want to drop them before releasing v2 anyway.1 parent a63f517 commit 3a9a00a
122 files changed
Lines changed: 1178 additions & 3547 deletions
File tree
- cloud-annotations/src
- main/java/cloud/commandframework/annotations
- test/java/cloud/commandframework/annotations
- feature
- cloud-core/src
- main/java/cloud/commandframework
- arguments
- compound
- standard
- exceptions
- test/java/cloud/commandframework
- arguments/standard
- context
- feature
- cloud-discord
- cloud-javacord/src/main/java/cloud/commandframework/javacord
- cloud-jda/src/main/java/cloud/commandframework/jda/parsers
- cloud-irc/cloud-pircbotx/src/main/java/cloud/commandframework/pircbotx/arguments
- cloud-kotlin/cloud-kotlin-extensions/src
- main/kotlin/cloud/commandframework/kotlin
- test/kotlin/cloud/commandframework/kotlin
- cloud-minecraft
- cloud-brigadier/src/main/java/cloud/commandframework/brigadier
- cloud-bukkit/src/main/java/cloud/commandframework/bukkit
- argument
- parsers
- location
- selector
- cloud-bungee/src/main/java/cloud/commandframework/bungee
- arguments
- cloud-cloudburst/src/main/java/cloud/commandframework/cloudburst
- cloud-fabric/src
- main/java/cloud/commandframework/fabric
- argument
- server
- testmod/java/cloud/commandframework/fabric/testmod
- cloud-minecraft-extras/src/main/java/cloud/commandframework/minecraft/extras
- cloud-paper/src/main/java/cloud/commandframework/paper
- argument
- cloud-sponge7/src/main/java/cloud/commandframework/sponge7
- cloud-velocity/src/main/java/cloud/commandframework/velocity
- arguments
- examples
- example-bukkit/src/main/java/cloud/commandframework/examples/bukkit
- example-bungee/src/main/java/cloud/commandframework/examples/bungee
- example-jda/src/main/java/cloud/commandframework/examples/jda
- example-velocity/src/main/java/cloud/commandframework/examples/velocity
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 18 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
562 | 563 | | |
563 | 564 | | |
564 | 565 | | |
565 | | - | |
566 | | - | |
| 566 | + | |
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
| 570 | + | |
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
576 | | - | |
| 575 | + | |
577 | 576 | | |
578 | 577 | | |
579 | 578 | | |
| |||
585 | 584 | | |
586 | 585 | | |
587 | 586 | | |
588 | | - | |
589 | | - | |
| 587 | + | |
| 588 | + | |
590 | 589 | | |
591 | 590 | | |
592 | 591 | | |
593 | 592 | | |
594 | 593 | | |
595 | 594 | | |
596 | | - | |
597 | | - | |
| 595 | + | |
598 | 596 | | |
599 | 597 | | |
600 | 598 | | |
| |||
623 | 621 | | |
624 | 622 | | |
625 | 623 | | |
626 | | - | |
| 624 | + | |
627 | 625 | | |
628 | 626 | | |
629 | 627 | | |
| |||
701 | 699 | | |
702 | 700 | | |
703 | 701 | | |
704 | | - | |
| 702 | + | |
705 | 703 | | |
706 | 704 | | |
707 | 705 | | |
| |||
747 | 745 | | |
748 | 746 | | |
749 | 747 | | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | 748 | | |
761 | 749 | | |
762 | 750 | | |
| |||
789 | 777 | | |
790 | 778 | | |
791 | 779 | | |
792 | | - | |
793 | | - | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
794 | 789 | | |
795 | 790 | | |
796 | 791 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | | - | |
256 | | - | |
| 255 | + | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
109 | | - | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
0 commit comments