Skip to content

Commit f36a5b3

Browse files
committed
Update Tree Builders
1 parent 3edaf20 commit f36a5b3

File tree

3 files changed

+42
-43
lines changed

3 files changed

+42
-43
lines changed

src/main/java/org/spongepowered/api/command/registrar/CommandRegistrar.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@ public interface CommandRegistrar extends CatalogType {
145145
*
146146
* @param builder The builder to supply command information to
147147
*/
148-
void completeCommandTree(CommandTreeBuilder.Empty builder);
148+
void completeCommandTree(CommandTreeBuilder.Basic builder);
149149

150150
}

src/main/java/org/spongepowered/api/command/registrar/tree/ClientCompletionKeys.java

+35-35
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,30 @@ public class ClientCompletionKeys {
4949
* Completions will attempt to return arguments that represent
5050
* {@link BlockState}s
5151
*/
52-
public static ClientCompletionKey<CommandTreeBuilder.Empty> BLOCK_STATE =
52+
public static ClientCompletionKey<CommandTreeBuilder.Basic> BLOCK_STATE =
5353
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "BLOCK_STATE");
5454

5555
/**
5656
* Completions will attempt to return arguments that represent
5757
* {@link BlockState}s - // TODO: Predicate
5858
*/
59-
public static ClientCompletionKey<CommandTreeBuilder.Empty> BLOCK_PREDICATE =
59+
public static ClientCompletionKey<CommandTreeBuilder.Basic> BLOCK_PREDICATE =
6060
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "BLOCK_PREDICATE");
6161

62-
public static ClientCompletionKey<CommandTreeBuilder.Empty> BOOLEAN =
62+
public static ClientCompletionKey<CommandTreeBuilder.Basic> BOOLEAN =
6363
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "BOOLEAN");
6464

6565
/**
6666
* Completions will attempt to return arguments that represent
6767
* {@link Color}s
6868
*/
69-
public static ClientCompletionKey<CommandTreeBuilder.Empty> COLOR =
69+
public static ClientCompletionKey<CommandTreeBuilder.Basic> COLOR =
7070
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "COLOR");
7171

72-
public static ClientCompletionKey<CommandTreeBuilder.Empty> DIMENSION =
72+
public static ClientCompletionKey<CommandTreeBuilder.Basic> DIMENSION =
7373
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "DIMENSION");
7474

75-
public static ClientCompletionKey<CommandTreeBuilder.Empty> DOUBLE =
75+
public static ClientCompletionKey<CommandTreeBuilder.Basic> DOUBLE =
7676
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "DOUBLE");
7777

7878
/**
@@ -82,130 +82,130 @@ public class ClientCompletionKeys {
8282
public static ClientCompletionKey<CommandTreeBuilder.EntitySelection> ENTITY =
8383
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "ENTITY");
8484

85-
public static ClientCompletionKey<CommandTreeBuilder.Empty> ENTITY_ANCHOR =
85+
public static ClientCompletionKey<CommandTreeBuilder.Basic> ENTITY_ANCHOR =
8686
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "ENTITY_ANCHOR");
8787

88-
public static ClientCompletionKey<CommandTreeBuilder.Empty> ENTITY_SUMMON =
88+
public static ClientCompletionKey<CommandTreeBuilder.Basic> ENTITY_SUMMON =
8989
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "ENTITY_SUMMON");
9090

91-
public static ClientCompletionKey<CommandTreeBuilder.Empty> FLOAT =
91+
public static ClientCompletionKey<CommandTreeBuilder.Basic> FLOAT =
9292
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "FLOAT");
9393

9494
public static ClientCompletionKey<CommandTreeBuilder.Range<Float>> FLOAT_RANGE =
9595
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "FLOAT_RANGE");
9696

97-
public static ClientCompletionKey<CommandTreeBuilder.Empty> FUNCTION =
97+
public static ClientCompletionKey<CommandTreeBuilder.Basic> FUNCTION =
9898
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "FUNCTION");
9999

100100
/**
101101
* Completions will attempt to return arguments that represent
102102
* {@link GameProfile}s
103103
*/
104-
public static ClientCompletionKey<CommandTreeBuilder.Empty> GAME_PROFILE =
104+
public static ClientCompletionKey<CommandTreeBuilder.Basic> GAME_PROFILE =
105105
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "GAME_PROFILE");
106106

107107
public static ClientCompletionKey<CommandTreeBuilder.Range<Integer>> INT_RANGE =
108108
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "INT_RANGE");
109109

110-
public static ClientCompletionKey<CommandTreeBuilder.Empty> INTEGER =
110+
public static ClientCompletionKey<CommandTreeBuilder.Basic> INTEGER =
111111
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "INTEGER");
112112

113-
public static ClientCompletionKey<CommandTreeBuilder.Empty> ITEM_ENCHANTMENT =
113+
public static ClientCompletionKey<CommandTreeBuilder.Basic> ITEM_ENCHANTMENT =
114114
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "ITEM_ENCHANTMENT");
115115

116-
public static ClientCompletionKey<CommandTreeBuilder.Empty> ITEM_SLOT =
116+
public static ClientCompletionKey<CommandTreeBuilder.Basic> ITEM_SLOT =
117117
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "ITEM_SLOT");
118118

119-
public static ClientCompletionKey<CommandTreeBuilder.Empty> LONG =
119+
public static ClientCompletionKey<CommandTreeBuilder.Basic> LONG =
120120
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "LONG");
121121

122-
public static ClientCompletionKey<CommandTreeBuilder.Empty> MESSAGE =
122+
public static ClientCompletionKey<CommandTreeBuilder.Basic> MESSAGE =
123123
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "MESSAGE");
124124

125-
public static ClientCompletionKey<CommandTreeBuilder.Empty> MOB_EFFECT =
125+
public static ClientCompletionKey<CommandTreeBuilder.Basic> MOB_EFFECT =
126126
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "MOB_EFFECT");
127127

128128
// TODO -> dataview?
129-
public static ClientCompletionKey<CommandTreeBuilder.Empty> NBT_COMPOUND =
129+
public static ClientCompletionKey<CommandTreeBuilder.Basic> NBT_COMPOUND =
130130
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "NBT_TAG");
131131

132132
// TODO -> datapath?
133-
public static ClientCompletionKey<CommandTreeBuilder.Empty> NBT_PATH =
133+
public static ClientCompletionKey<CommandTreeBuilder.Basic> NBT_PATH =
134134
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "NBT_PATH");
135135

136-
public static ClientCompletionKey<CommandTreeBuilder.Empty> NBT_TAG =
136+
public static ClientCompletionKey<CommandTreeBuilder.Basic> NBT_TAG =
137137
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "NBT_TAG");
138138

139-
public static ClientCompletionKey<CommandTreeBuilder.Empty> OBJECTIVE =
139+
public static ClientCompletionKey<CommandTreeBuilder.Basic> OBJECTIVE =
140140
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "OBJECTIVE");
141141

142-
public static ClientCompletionKey<CommandTreeBuilder.Empty> OBJECTIVE_CRITERIA =
142+
public static ClientCompletionKey<CommandTreeBuilder.Basic> OBJECTIVE_CRITERIA =
143143
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "OBJECTIVE_CRITERIA");
144144

145145
// TODO -> check
146-
public static ClientCompletionKey<CommandTreeBuilder.Empty> OPERATION =
146+
public static ClientCompletionKey<CommandTreeBuilder.Basic> OPERATION =
147147
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "OPERATION");
148148

149-
public static ClientCompletionKey<CommandTreeBuilder.Empty> PARTICLE =
149+
public static ClientCompletionKey<CommandTreeBuilder.Basic> PARTICLE =
150150
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "PARTICLE");
151151

152-
public static ClientCompletionKey<CommandTreeBuilder.Empty> RESOURCE_LOCATION =
152+
public static ClientCompletionKey<CommandTreeBuilder.Basic> RESOURCE_LOCATION =
153153
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "RESOURCE_LOCATION");
154154

155-
public static ClientCompletionKey<CommandTreeBuilder.Empty> ROTATION =
155+
public static ClientCompletionKey<CommandTreeBuilder.Basic> ROTATION =
156156
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "ROTATION");
157157

158158
public static ClientCompletionKey<CommandTreeBuilder.Amount> SCORE_HOLDER =
159159
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "SCORE_HOLDER");
160160

161-
public static ClientCompletionKey<CommandTreeBuilder.Empty> SCOREBOARD_SLOT =
161+
public static ClientCompletionKey<CommandTreeBuilder.Basic> SCOREBOARD_SLOT =
162162
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "SCOREBOARD_SLOT");
163163

164164
public static ClientCompletionKey<CommandTreeBuilder.StringParser> STRING =
165165
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "STRING");
166166

167-
public static ClientCompletionKey<CommandTreeBuilder.Empty> SWIZZLE =
167+
public static ClientCompletionKey<CommandTreeBuilder.Basic> SWIZZLE =
168168
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "SWIZZLE");
169169

170-
public static ClientCompletionKey<CommandTreeBuilder.Empty> TEAM =
170+
public static ClientCompletionKey<CommandTreeBuilder.Basic> TEAM =
171171
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "TEAM");
172172

173173
/**
174174
* Completions will attempt to return arguments that represent
175175
* {@link Text}s
176176
*/
177-
public static ClientCompletionKey<CommandTreeBuilder.Empty> TEXT =
177+
public static ClientCompletionKey<CommandTreeBuilder.Basic> TEXT =
178178
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "TEXT");
179179

180-
public static ClientCompletionKey<CommandTreeBuilder.Empty> TIME =
180+
public static ClientCompletionKey<CommandTreeBuilder.Basic> TIME =
181181
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "TIME");
182182

183183
/**
184184
* Completions will attempt to return arguments that represent a
185185
* real-space position (that is, two-dimensional decimal co-ordinates).
186186
*/
187-
public static ClientCompletionKey<CommandTreeBuilder.Empty> VECTOR_2D =
187+
public static ClientCompletionKey<CommandTreeBuilder.Basic> VECTOR_2D =
188188
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "VECTOR_2D");
189189

190190
/**
191191
* Completions will attempt to return arguments that represent a
192192
* block position (that is, two-dimensional integer co-ordinates).
193193
*/
194-
public static ClientCompletionKey<CommandTreeBuilder.Empty> VECTOR_2I =
194+
public static ClientCompletionKey<CommandTreeBuilder.Basic> VECTOR_2I =
195195
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "VECTOR_2I");
196196

197197
/**
198198
* Completions will attempt to return arguments that represent a
199199
* real-space position (that is, three-dimensional decimal co-ordinates).
200200
*/
201-
public static ClientCompletionKey<CommandTreeBuilder.Empty> VECTOR_3D =
201+
public static ClientCompletionKey<CommandTreeBuilder.Basic> VECTOR_3D =
202202
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "VECTOR_3D");
203203

204204
/**
205205
* Completions will attempt to return arguments that represent a
206206
* block position (that is, three-dimensional integer co-ordinates).
207207
*/
208-
public static ClientCompletionKey<CommandTreeBuilder.Empty> VECTOR_3I =
208+
public static ClientCompletionKey<CommandTreeBuilder.Basic> VECTOR_3I =
209209
DummyObjectProvider.createExtendedFor(ClientCompletionKey.class, "VECTOR_3I");
210210

211211
// SORTFIELDS: OFF

src/main/java/org/spongepowered/api/command/registrar/tree/CommandTreeBuilder.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public interface CommandTreeBuilder<T extends CommandTreeBuilder<T>> {
4444
* {@link CommandTreeBuilder} for the newly created child.
4545
* @return This, for chaining.
4646
*/
47-
T child(String key, Consumer<Empty> childNode);
47+
T child(String key, Consumer<Basic> childNode);
4848

4949
/**
5050
* Creates a child of this node with the given key that accepts a
@@ -62,14 +62,13 @@ public interface CommandTreeBuilder<T extends CommandTreeBuilder<T>> {
6262
<S extends CommandTreeBuilder<S>> T child(String key, ClientCompletionKey<S> completionKey, Consumer<S> childNode);
6363

6464
/**
65-
* Declares that the given {@code key} should be considered as if the
66-
* string specified in {@code to} has been executed.
65+
* Declares that this element will redirect processing to the given node
66+
* <strong>after</strong> this node has been processed.
6767
*
68-
* @param key The key
69-
* @param to The string to redirect to
68+
* @param to The node to redirect to
7069
* @return This, for chaining
7170
*/
72-
T redirect(String key, String to);
71+
T redirect(String to);
7372

7473
/**
7574
* Declares that the node this {@link CommandTreeBuilder} represents is
@@ -119,7 +118,7 @@ public interface CommandTreeBuilder<T extends CommandTreeBuilder<T>> {
119118
/**
120119
* A {@link CommandTreeBuilder} with no known properties to set.
121120
*/
122-
interface Empty extends CommandTreeBuilder<Empty> { }
121+
interface Basic extends CommandTreeBuilder<Basic> { }
123122

124123
/**
125124
* A {@link CommandTreeBuilder} that allows for a min-max range to be set.

0 commit comments

Comments
 (0)