Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
CommandRegistry.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/network/packet/AvailableCommandsPacket.h"
5#include "mc/server/commands/BlockStateCommandParam.h"
6#include "mc/server/commands/CommandChainedSubcommand.h"
7#include "mc/server/commands/CommandCompareOperator.h"
8#include "mc/server/commands/CommandFilePath.h"
9#include "mc/server/commands/CommandIntegerRange.h"
10#include "mc/server/commands/CommandMessage.h"
11#include "mc/server/commands/CommandOperator.h"
12#include "mc/server/commands/CommandRawText.h"
13#include "mc/server/commands/CommandWildcardInt.h"
14#include "mc/server/commands/WildcardCommandSelector.h"
15
16// auto generated inclusion list
17#include "mc/deps/core/utility/typeid_t.h"
18#include "mc/platform/UUID.h"
19#include "mc/platform/brstd/associative_adapter.h"
20#include "mc/platform/brstd/copyable_function.h"
21#include "mc/server/commands/CommandFlag.h"
22#include "mc/server/commands/CommandLexer.h"
23#include "mc/server/commands/CommandPermissionLevel.h"
24#include "mc/server/commands/CommandSelector.h"
25#include "mc/server/commands/CommandStatus.h"
26#include "mc/server/commands/CommandTypeFlag.h"
27#include "mc/server/commands/CommandVersion.h"
28#include "mc/server/commands/SemanticConstraint.h"
29#include "mc/world/actor/selectors/InvertableFilter.h"
30
31// auto generated forward declare list
32// clang-format off
33class Actor;
35class BlockType;
36class Command;
37class CommandOrigin;
39class CommandRunStats;
42class Packet;
43class PlayerListEntry;
48namespace Json { class Value; }
49// clang-format on
50
51class CommandRegistry {
52public:
53 // CommandRegistry inner types declare
54 // clang-format off
55 struct RegistryState;
56 struct SoftEnum;
57 class Symbol;
58 struct ConstrainedValue;
59 struct Factorization;
60 struct LexicalToken;
62 struct Overload;
63 struct ParamSymbols;
64 struct ParseToken;
65 struct ChainedSubcommand;
66 struct Enum;
67 struct ParamParseRule;
68 struct ParseRule;
69 struct SemanticInfo;
70 struct Signature;
71 struct SymbolHasher;
72 struct SymbolPairHasher;
73 struct ParseTable;
74 class Parser;
75 // clang-format on
76
77 // CommandRegistry inner types define
78
79 using ParseFunction = bool (::CommandRegistry::*)(
80 void*,
82 ::CommandOrigin const&,
83 int,
84 ::std::string&,
85 ::std::vector<::std::string>&
86 ) const;
87
88 enum class HardNonTerminal : int {
89 Epsilon = 1048576,
90 Int = 1048577,
91 Float = 1048578,
92 Val = 1048579,
93 RVal = 1048580,
94 WildcardInt = 1048581,
95 Operator = 1048582,
96 CompareOperator = 1048583,
97 Selection = 1048584,
98 StandaloneSelection = 1048585,
99 WildcardSelection = 1048586,
100 NonIdSelector = 1048587,
101 ScoresArg = 1048588,
102 ScoresArgs = 1048589,
103 ScoreSelectParam = 1048590,
104 ScoreSelector = 1048591,
105 TagSelector = 1048592,
106 FilePath = 1048593,
107 FilePathVal = 1048594,
108 FilePathCont = 1048595,
109 IntegerRangeVal = 1048596,
110 IntegerRangePostVal = 1048597,
111 IntegerRange = 1048598,
112 FullIntegerRange = 1048599,
113 RationalRangeVal = 1048600,
114 RationalRangePostVal = 1048601,
115 RationalRange = 1048602,
116 FullRationalRange = 1048603,
117 SelArgs = 1048604,
118 Args = 1048605,
119 Arg = 1048606,
120 MArg = 1048607,
121 MValue = 1048608,
122 NameArg = 1048609,
123 TypeArg = 1048610,
124 FamilyArg = 1048611,
125 HasPermissionArg = 1048612,
126 HasPermissionArgs = 1048613,
127 HasPermissionSelector = 1048614,
128 HasPermissionElement = 1048615,
129 HasPermissionElements = 1048616,
130 TagArg = 1048617,
131 HasItemElement = 1048618,
132 HasItemElements = 1048619,
133 HasItemArg = 1048620,
134 HasItemArgs = 1048621,
135 HasItemSelector = 1048622,
136 EquipmentSlotEnum = 1048623,
137 PropertyValue = 1048624,
138 HasPropertyParamValue = 1048625,
139 HasPropertyParamEnumValue = 1048626,
140 HasPropertyArg = 1048627,
141 HasPropertyArgs = 1048628,
142 HasPropertyElement = 1048629,
143 HasPropertyElements = 1048630,
144 HasPropertySelector = 1048631,
145 Id = 1048632,
146 IdCont = 1048633,
147 CoordXInt = 1048634,
148 CoordYInt = 1048635,
149 CoordZInt = 1048636,
150 CoordXFloat = 1048637,
151 CoordYFloat = 1048638,
152 CoordZFloat = 1048639,
153 Position = 1048640,
154 PositionFloat = 1048641,
155 MessageExp = 1048642,
156 Message = 1048643,
157 MessageRoot = 1048644,
158 PostSelector = 1048645,
159 RawText = 1048646,
160 RawTextCont = 1048647,
161 JsonValue = 1048648,
162 JsonField = 1048649,
163 JsonObject = 1048650,
164 JsonObjectFields = 1048651,
165 JsonObjectCont = 1048652,
166 JsonArray = 1048653,
167 JsonArrayValues = 1048654,
168 JsonArrayCont = 1048655,
169 BlockState = 1048656,
170 BlockStateKey = 1048657,
171 BlockStateValue = 1048658,
172 BlockStateValues = 1048659,
173 BlockStateArray = 1048660,
174 BlockStateArrayCont = 1048661,
175 ClockTimeMarkerName = 1048662,
176 PoiTag = 1048663,
177 PoiType = 1048664,
178 Command = 1048665,
179 SlashCommand = 1048666,
180 CodeBuilderArg = 1048667,
181 CodeBuilderArgs = 1048668,
182 CodeBuilderSelectParam = 1048669,
183 CodeBuilderSelector = 1048670,
184 };
185
187 public:
188 // member variables
189 // NOLINTBEGIN
190 ::ll::TypedStorage<4, 4, uint> signatureCount;
191 ::ll::TypedStorage<4, 4, uint> enumValueCount;
192 ::ll::TypedStorage<4, 4, uint> postfixCount;
193 ::ll::TypedStorage<4, 4, uint> enumCount;
194 ::ll::TypedStorage<4, 4, uint> enumLookupCount;
195 ::ll::TypedStorage<4, 4, uint> typeLookupCount;
196 ::ll::TypedStorage<4, 4, uint> factorizationCount;
197 ::ll::TypedStorage<4, 4, uint> optionalCount;
198 ::ll::TypedStorage<4, 4, uint> ruleCount;
199 ::ll::TypedStorage<4, 4, uint> softEnumCount;
200 ::ll::TypedStorage<4, 4, uint> constraintCount;
201 ::ll::TypedStorage<4, 4, uint> chainedSubcommandCount;
202 ::ll::TypedStorage<4, 4, uint> chainedSubcommandValueCount;
203 ::ll::TypedStorage<8, 24, ::std::vector<uint>> enumValuesCount;
204 ::ll::TypedStorage<8, 24, ::std::vector<uint>> constrainedValueCount;
205 ::ll::TypedStorage<8, 24, ::std::vector<uint>> softEnumValuesCount;
206 // NOLINTEND
207
208 public:
209 // member functions
210 // NOLINTBEGIN
212 // NOLINTEND
213
214 public:
215 // destructor thunk
216 // NOLINTBEGIN
217 MCNAPI void $dtor();
218 // NOLINTEND
219 };
220
221 struct SoftEnum {
222 public:
223 // member variables
224 // NOLINTBEGIN
225 ::std::string mName;
226 ::std::vector<::std::string> mValues;
227 // NOLINTEND
228
229 public:
230 // prevent constructor by default
231 SoftEnum();
232
233 public:
234 // member functions
235 // NOLINTBEGIN
236 MCNAPI SoftEnum(::std::string const& name, ::std::vector<::std::string> values);
237 // NOLINTEND
238
239 public:
240 // constructor thunks
241 // NOLINTBEGIN
242 MCNAPI void* $ctor(::std::string const& name, ::std::vector<::std::string> values);
243 // NOLINTEND
244 };
245
246 class Symbol {
247 public:
248 int mValue{-1}; // this+0x0
249
250 static int const NonTerminalBit = 0x100000;
251 static int const EnumBit = 0x200000;
252 static int const OptionalBit = 0x400000;
253 static int const FactorizationBit = 0x800000;
254 static int const PostfixBit = 0x1000000;
255 static int const EnumValueBit = 0x2000000;
256 static int const SoftEnumBit = 0x4000000;
257
258 Symbol() = default;
259
260 Symbol(int val) : mValue(val) {}
261
262 // not trivially copyable
263 Symbol(Symbol const& other) : mValue(other.mValue) {}
264
265 Symbol(HardNonTerminal data) : mValue(static_cast<int>(data)) {}
266
267 Symbol(CommandLexer::TokenType data) : mValue(static_cast<int>(data)) {}
268
269 Symbol& operator=(Symbol const& other) {
270 mValue = other.mValue;
271 return *this;
272 }
273
274 [[nodiscard]] inline bool operator==(Symbol const& other) const { return mValue == other.mValue; }
275
276 uint64 toIndex() const { return mValue & 0xffffffffe00fffffull; }
277 };
278
280 public:
281 // member variables
282 // NOLINTBEGIN
283 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> mValue;
284 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> mEnum;
285 ::ll::TypedStorage<8, 24, ::std::vector<uchar>> mConstraints;
286 // NOLINTEND
287 };
288
290 public:
291 // member variables
292 // NOLINTBEGIN
293 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> commandSymbol;
294 // NOLINTEND
295 };
296
297 struct LexicalToken {
298 public:
299 // member variables
300 // NOLINTBEGIN
301 char const* mText;
302 uint mLength;
304 ::CommandRegistry::Symbol mIdentifierInfo;
305 ::CommandRegistry const& mRegistry;
306 // NOLINTEND
307
308 public:
309 // prevent constructor by default
310 LexicalToken& operator=(LexicalToken const&);
311 LexicalToken(LexicalToken const&);
312 LexicalToken();
313
314 public:
315 // member functions
316 // NOLINTBEGIN
317 MCNAPI ::CommandRegistry::LexicalToken& operator=(::CommandLexer::Token const& token);
318 // NOLINTEND
319 };
320
322 public:
323 // member variables
324 // NOLINTBEGIN
325 ::ll::TypedStorage<4, 4, int> parameterCount;
326 ::ll::TypedStorage<4, 4, int> followingRuleIndex;
327 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> paramSymbol;
328 // NOLINTEND
329 };
330
331 struct Overload {
332 public:
333 // Overload inner types define
334 using AllocFunction = ::brstd::copyable_function<::std::unique_ptr<::Command>() const>;
335
336 public:
337 // member variables
338 // NOLINTBEGIN
339 ::CommandVersion version;
340 AllocFunction alloc;
341 ::std::vector<::CommandParameterData> params;
342 int versionOffset;
343 bool isChaining;
344 ::std::vector<::CommandRegistry::Symbol> paramsSymbol;
345 // NOLINTEND
346 };
347
349 public:
350 // member variables
351 // NOLINTBEGIN
352 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> x;
353 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> y;
354 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> z;
355 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> dx;
356 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> dy;
357 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> dz;
358 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> r;
359 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> rm;
360 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> rx;
361 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> rxm;
362 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> ry;
363 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> rym;
364 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> l;
365 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> lm;
366 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> c;
367 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> m;
368 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> name;
369 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> type;
370 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> family;
371 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> score;
372 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> tag;
373 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> hasitem;
374 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> haspermission;
375 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> hasproperty;
376 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> codebuilder;
377 // NOLINTEND
378 };
379
380 struct ParseToken {
381 public:
382 // member variables
383 // NOLINTBEGIN
384 ::std::unique_ptr<::CommandRegistry::ParseToken> child;
385 ::std::unique_ptr<::CommandRegistry::ParseToken> next;
387 char const* text;
388 uint length;
390 // NOLINTEND
391
392 public:
393 // member functions
394 // NOLINTBEGIN
395 MCAPI ::std::string toString() const;
396
397 MCNAPI ~ParseToken();
398 // NOLINTEND
399
400 public:
401 // destructor thunk
402 // NOLINTBEGIN
403 MCNAPI void $dtor();
404 // NOLINTEND
405 };
406
408 public:
409 // member variables
410 // NOLINTBEGIN
411 ::std::string name;
413 ParseFunction parse;
414 ::std::vector<::std::pair<uint64, uint>> values;
415 // NOLINTEND
416 };
417
418 struct Enum {
419 public:
420 // member variables
421 // NOLINTBEGIN
422 ::std::string name;
424 ParseFunction parse;
425 ::std::vector<::std::pair<uint64, uint64>> values;
426 // NOLINTEND
427 };
428
430 public:
431 // member variables
432 // NOLINTBEGIN
433 ::ll::TypedStorage<
434 8,
435 8,
436 bool (CommandRegistry::*)(
437 void*,
439 ::CommandOrigin const&,
440 int,
441 ::std::string&,
442 ::std::vector<::std::string>&
443 ) const>
444 parse;
445 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> symbol;
446 // NOLINTEND
447 };
448
449 struct ParseRule {
450 public:
451 // member variables
452 // NOLINTBEGIN
453 ::ll::TypedStorage<4, 4, ::CommandRegistry::Symbol> nonTerminal;
454 ::ll::TypedStorage<
455 8,
456 64,
458 process;
459 ::ll::TypedStorage<8, 24, ::std::vector<::CommandRegistry::Symbol>> derivation;
460 ::ll::TypedStorage<4, 8, ::CommandVersion> versions;
461 // NOLINTEND
462
463 public:
464 // prevent constructor by default
465 ParseRule& operator=(ParseRule const&);
466 ParseRule(ParseRule const&);
467 ParseRule();
468
469 public:
470 // member functions
471 // NOLINTBEGIN
472 MCNAPI ::CommandRegistry::ParseRule& operator=(::CommandRegistry::ParseRule&& rhs);
473 // NOLINTEND
474 };
475
477 public:
478 // member variables
479 // NOLINTBEGIN
480 ::ll::TypedStorage<1, 1, bool> mIsValid;
481 ::ll::TypedStorage<8, 24, ::std::vector<::CommandRegistry::Symbol>> mConstrainedParams;
482 ::ll::TypedStorage<8, 32, ::std::string> mSoftEnumText;
483 ::ll::TypedStorage<8, 32, ::std::string> mSoftEnumEscapeCharExceptions;
484 ::ll::TypedStorage<8, 16, ::std::set<::CommandRegistry::Symbol>> mAlreadyCompletedSymbols;
485 // NOLINTEND
486 };
487
488 struct Signature {
489 public:
490 // member variables
491 // NOLINTBEGIN
492 ::std::string name;
493 ::std::string description;
494 ::std::vector<::CommandRegistry::Overload> overloads;
495 ::std::vector<uint> chainedSubcommandIndexes;
496 ::CommandPermissionLevel permissionLevel;
497 ::CommandRegistry::Symbol commandSymbol;
498 ::CommandRegistry::Symbol commandAliasEnum;
499 ::CommandFlag flags;
500 int firstRule;
501 int firstFactorization;
502 int firstOptional;
503 bool runnable;
504 uint64 ruleCounter;
505 // NOLINTEND
506
507 public:
508 // member functions
509 // NOLINTBEGIN
510 MCNAPI ~Signature();
511 // NOLINTEND
512
513 public:
514 // destructor thunk
515 // NOLINTBEGIN
516 MCNAPI void $dtor();
517 // NOLINTEND
518 };
519
520 struct SymbolHasher {};
521
523
524 struct ParseTable {
525 public:
526 // member variables
527 // NOLINTBEGI
528 ::std::map<
530 ::entt::dense_set<::CommandRegistry::Symbol, ::CommandRegistry::SymbolHasher, ::std::equal_to<void>>>
531 first;
532
533 ::std::map<
535 ::entt::dense_set<::CommandRegistry::Symbol, ::CommandRegistry::SymbolHasher, ::std::equal_to<void>>>
536 follow;
537 ::entt::dense_map<
538 ::std::pair<::CommandRegistry::Symbol, ::CommandRegistry::Symbol>,
539 int,
541 ::std::equal_to<void>>
542 predict;
543 ::entt::dense_set<::CommandRegistry::Symbol, ::CommandRegistry::SymbolHasher, ::std::equal_to<void>>
544 nullableSymbols;
545 ::std::chrono::nanoseconds buildDuration;
546 // NOLINTEND
547 };
548
549 class Parser {
550 public:
551 // member variables
552 // NOLINTBEGIN
553 ::ll::TypedStorage<8, 8, ::CommandRegistry const&> mRegistry;
554 ::ll::TypedStorage<8, 8, ::CommandRegistry::ParseTable const*> mParseTable;
555 ::ll::TypedStorage<8, 40, ::std::deque<::std::pair<::CommandRegistry::Symbol, ::CommandRegistry::ParseToken*>>>
556 mStack;
557 ::ll::TypedStorage<8, 32, ::CommandRegistry::LexicalToken> mNext;
558 ::ll::TypedStorage<8, 32, ::std::string> mInput;
559 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandRegistry::ParseToken>> mRoot;
560 ::ll::TypedStorage<8, 32, ::std::string> mError;
561 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mErrorParams;
562 ::ll::TypedStorage<4, 4, int> mVersion;
563 ::ll::TypedStorage<1, 1, bool> mGenerateParams;
564 ::ll::TypedStorage<1, 1, bool> mBreakAtEnd;
565 // NOLINTEND
566
567 public:
568 // prevent constructor by default
569 Parser& operator=(Parser const&);
570 Parser(Parser const&);
571 Parser();
572
573 public:
574 // member functions
575 // NOLINTBEGIN
576 MCAPI Parser(::CommandRegistry const& registry, int version);
577
578 MCNAPI bool _parse(::std::string const& in);
579
580 MCNAPI ::std::unique_ptr<::CommandSelector<::Actor>>
581 createSelector(::std::string const& selectorString, ::CommandOrigin const& origin);
582
583 MCNAPI ::std::vector<::std::string> getErrorParams() const;
584
585 MCAPI bool parseCommand(::std::string const& in);
586
587 MCNAPI bool parseSelector(::std::string const& in);
588
589 MCAPI ~Parser();
590 // NOLINTEND
591
592 public:
593 // constructor thunks
594 // NOLINTBEGIN
595 MCAPI void* $ctor(::CommandRegistry const& registry, int version);
596 // NOLINTEND
597
598 public:
599 // destructor thunk
600 // NOLINTBEGIN
601 MCAPI void $dtor();
602 // NOLINTEND
603 };
604
605 using ChainedSubcommandConversionFunction = ::std::function<void(void*, uint64)>;
606
607 using ChainedSubcommandID = uint;
608
609 using ChainedSubcommandValueID = uint64;
610
611 using CommandOverrideFunctor =
612 ::std::function<void(::std::string const&, ::CommandFlag&, ::CommandPermissionLevel&)>;
613
614 using CommandVisitCallback = ::std::function<bool(::CommandRegistry::ParseToken const*, ::CommandOrigin const&)>;
615
616 using ConstrainedValueID = uint;
617
618 using ConstrainedValueLookupKey = ::std::pair<uint64, uint>;
619
620 using CustomStorageGetFn = void* (*)(::Command*, int);
621
622 using CustomStorageIsSetFn = bool* (*)(::Command*, int);
623
624 using EnumConversionFunction = ::std::function<void(void*, uint64)>;
625
626 using EnumID = uint;
627
628 using EnumValueID = uint64;
629
630 using HardTerminal = ::CommandLexer::TokenType;
631
632 using ParamVisitCallback = ::std::function<
634
635 using ParseMap = ::std::map<
637 ::entt::dense_set<::CommandRegistry::Symbol, ::CommandRegistry::SymbolHasher, ::std::equal_to<void>>>;
638
639 using ParseTableMap = ::std::map<uint, ::CommandRegistry::ParseTable>;
640
641 using PredictTable = ::entt::dense_map<
642 ::std::pair<::CommandRegistry::Symbol, ::CommandRegistry::Symbol>,
643 int,
645 ::std::equal_to<void>>;
646
647 using ProcessFunction =
649
650 using RuleIndex = int;
651
652 using ScoreboardScoreAccessor = ::std::function<int(bool&, ::std::string const&, ::Actor const&)>;
653
654 using SemanticConstraintID = uchar;
655
656 using SoftEnumID = uint;
657
659
660 using SymbolSet =
661 ::entt::dense_set<::CommandRegistry::Symbol, ::CommandRegistry::SymbolHasher, ::std::equal_to<void>>;
662
663 using SymbolVector = ::std::vector<::CommandRegistry::Symbol>;
664
665 using Terminal = ::CommandRegistry::Symbol;
666
667 using ValueTypeID = uint64;
668
669public:
670 // member variables
671 // NOLINTBEGIN
672 ::std::function<void(::Packet const&)> mNetworkUpdateCallback;
673 ScoreboardScoreAccessor mGetScoreForObjective;
674 bool mIsEduMode;
675 bool mIsCodeBuilderEnabled;
676 ::std::vector<::CommandRegistry::ParseRule> mRules;
677 ::std::map<uint, ::CommandRegistry::ParseTable> mParseTables;
678 ::std::vector<::CommandRegistry::OptionalParameterChain> mOptionals;
679 ::std::vector<::std::string> mEnumValues;
680 ::std::vector<::CommandRegistry::Enum> mEnums;
681 ::std::vector<::std::string> mChainedSubcommandValues;
682 ::std::vector<::CommandRegistry::ChainedSubcommand> mChainedSubcommands;
683 ::std::vector<::CommandRegistry::Factorization> mFactorizations;
684 ::std::vector<::std::string> mPostfixes;
685 ::std::map<::std::string, uint> mEnumLookup;
686 ::std::map<::std::string, uint64> mEnumValueLookup;
687 ::std::map<::std::string, uint> mChainedSubcommandLookup;
688 ::std::map<::std::string, uint64> mChainedSubcommandValueLookup;
689 ::std::vector<::CommandRegistry::Symbol> mCommandSymbols;
690 ::std::map<::std::string, ::CommandRegistry::Signature> mSignatures;
691 ::std::map<::Bedrock::typeid_t<::CommandRegistry>, int> mTypeLookup;
692 ::std::map<::std::string, ::std::string> mAliases;
693 ::std::vector<::SemanticConstraint> mSemanticConstraints;
694 ::std::map<::SemanticConstraint, uchar> mSemanticConstraintLookup;
695 ::std::vector<::CommandRegistry::ConstrainedValue> mConstrainedValues;
696 ::std::map<::std::pair<uint64, uint>, uint> mConstrainedValueLookup;
697 ::std::vector<::CommandRegistry::SoftEnum> mSoftEnums;
698 ::std::map<::std::string, uint> mSoftEnumLookup;
699 ::std::vector<::CommandRegistry::RegistryState> mStateStack;
701 ::std::unordered_set<int> mSkipOnEpsAutocompleteSymbols;
702 ::std::unordered_set<int> mAllowEmptySymbols;
703 CommandOverrideFunctor mCommandOverrideFunctor;
704 ::std::unique_ptr<::CommandRunStats> mCommandRunStats;
705 ::ll::TypedStorage<
706 8,
707 8,
708 ::std::string (*)(
709 ::std::string const&,
710 ::std::unordered_map<::mce::UUID, ::PlayerListEntry> const&,
712 )>
713 mAutoCompletePlayerMention;
714 // NOLINTEND
715
716 template <class T>
717 bool parse(
718 void* storage,
719 CommandRegistry::ParseToken const& token,
720 CommandOrigin const& origin,
721 int version,
722 std::string& error,
723 std::vector<std::string>& errorParams
724 ) const;
725
726 template <class E, class C>
727 bool parseEnum(
728 void* storage,
729 CommandRegistry::ParseToken const& token,
730 CommandOrigin const& origin,
731 int version,
732 std::string& error,
733 std::vector<std::string>& errorParams
734 ) const;
735
736 uint64 getEnumData(ParseToken const& token) const {
737 auto& values = mEnums[token.type.toIndex()].values;
738 return std::lower_bound(
739 values.begin(),
740 values.end(),
741 token.child->type.toIndex(),
742 [](auto& pair, auto& child) { return pair.first < child; }
743 )->second;
744 }
745
746 template <class T>
748 MCAPI static ParamParseRule const& instance();
749 };
750
751public:
752 // prevent constructor by default
753 CommandRegistry();
754
755public:
756 // member functions
757 // NOLINTBEGIN
758 MCAPI explicit CommandRegistry(::CommandRegistryArguments args);
759
760 MCNAPI ::CommandRegistry::Symbol _addChainedSubcommandValuesInternal(
761 ::std::string const& name,
762 ::std::vector<::std::pair<::std::string, uint>> const& strings,
764 bool (CommandRegistry::*parse)(
765 void*,
767 ::CommandOrigin const&,
768 int,
769 ::std::string&,
770 ::std::vector<::std::string>&
771 ) const,
773 );
774
775#ifdef LL_PLAT_C
776 MCNAPI ::CommandRegistry::Symbol _addChainedSubcommandValuesInternal(
777 ::std::string const& name,
778 ::std::vector<::std::pair<uint64, uint>> const& values,
780 bool (::CommandRegistry::*parse)(
781 void*,
783 ::CommandOrigin const&,
784 int,
785 ::std::string&,
786 ::std::vector<::std::string>&
787 ) const,
789 );
790#endif
791
792 MCAPI ::CommandRegistry::Symbol _addEnumValuesInternal(
793 ::std::string const& name,
794 ::std::vector<::std::pair<::std::string, uint64>> const& strings,
796 bool (CommandRegistry::*parse)(
797 void*,
799 ::CommandOrigin const&,
800 int,
801 ::std::string&,
802 ::std::vector<::std::string>&
803 ) const
804 );
805
806 MCNAPI ::CommandRegistry::Symbol _addEnumValuesInternal(
807 ::std::string const& name,
808 ::std::vector<::std::pair<uint64, uint64>> const& values,
810 bool (::CommandRegistry::*parse)(
811 void*,
813 ::CommandOrigin const&,
814 int,
815 ::std::string&,
816 ::std::vector<::std::string>&
817 ) const
818 );
819
820 MCNAPI ::std::unique_ptr<::CommandSelector<::Actor>> _createSelector(
822 ::CommandOrigin const& origin,
823 int version,
824 ::std::string& error,
825 ::std::vector<::std::string>& errorParams
826 ) const;
827
828#ifdef LL_PLAT_C
829 MCNAPI ::CommandRegistry::Symbol _getConstrainedParamEnumSymbol(::CommandRegistry::Symbol symbol) const;
830#endif
831
833 ::CommandRegistry::Symbol const& commandParamSymbol,
834 ::CommandOrigin const& origin,
835 ::CommandRegistry::Symbol const& value,
836 ::SemanticConstraint requiredConstraints
837 ) const;
838
839#ifdef LL_PLAT_C
840 MCNAPI void
841 addChainedSubcommandValuesToExisting(uint index, ::std::vector<::std::pair<uint64, uint>> const& values);
842#endif
843
844 MCAPI void addEnumValueConstraints(
845 ::std::string const& enumName,
846 ::std::vector<::std::string> const& values,
847 ::SemanticConstraint constraints
848 );
849
850 MCAPI int addEnumValues(::std::string const& name, ::std::vector<::std::string> const& values);
851
852 MCNAPI void addEnumValuesToExisting(uint index, ::std::vector<::std::pair<uint64, uint64>> const& values);
853
854#ifdef LL_PLAT_C
855 MCNAPI ::CommandRegistry::Symbol addPostfix(::std::string const& name);
856#endif
857
858 MCNAPI void addRule(
860 ::std::vector<::CommandRegistry::Symbol> derivation,
862 process,
863 ::CommandVersion versions
864 );
865
866 MCNAPI void addSemanticConstraint(::SemanticConstraint constraintType);
867
868 MCAPI int addSoftEnum(::std::string const& name, ::std::vector<::std::string> values);
869
870 MCAPI void addSoftEnumValues(::std::string const& enumName, ::std::vector<::std::string> values);
871
872 MCNAPI ::CommandRegistry::Symbol addSoftTerminal(::std::string const& name);
873
874#ifdef LL_PLAT_C
875 MCNAPI void autoComplete(
877 ::std::string const& cmdLine,
878 ::std::string const& partialMatch,
879 bool newWord,
880 ::CommandOrigin const& origin,
883 ) const;
884
885 MCNAPI void autoCompleteCommand(
886 ::std::string const& partialMatch,
887 ::CommandOrigin const& origin,
889 ) const;
890#endif
891
893
894 MCNAPI void buildFollowSet(
897 uint version,
898 ::std::set<::CommandRegistry::Symbol>& workingSet
899 ) const;
900
901 MCNAPI ::CommandRegistry::Symbol buildRules(
903 ::std::vector<::gsl::not_null<::CommandRegistry::Overload*>> const& overloads,
904 uint64 firstParam
905 );
906
907 MCNAPI bool
908 buildSelector(::ActorSelectorArgs const& args, ::CommandSelectorBase* output, ::std::string& error) const;
909
910#ifdef LL_PLAT_C
911 MCNAPI bool canCommandBeUsed(
912 ::std::string const& commandLine,
913 ::CommandPermissionLevel const& permissionLevel,
914 bool cheatsEnabled,
915 bool isEditorWorld,
916 bool isTeacher
917 ) const;
918#endif
919
920 MCNAPI ::std::unique_ptr<::Command> createCommand(
922 ::CommandOrigin const& origin,
923 int version,
924 ::std::string& error,
925 ::std::vector<::std::string>& errorParams
926 ) const;
927
928 MCAPI ::std::string describe(::CommandRegistry::Symbol symbol) const;
929
930#ifdef LL_PLAT_C
931 MCNAPI ::std::string describe(
932 ::CommandRegistry::Signature const& command,
933 ::std::string const& alias,
934 ::CommandRegistry::Overload const& overload,
935 uint highlight,
936 uint* start,
937 uint* length
938 ) const;
939#endif
940
941 MCNAPI void finalizeChainedSubcommandOverloadRules(char const* command);
942
943 MCNAPI ::CommandRegistry::Signature const* findCommand(::std::string const& name) const;
944
945 MCFOLD ::CommandRegistry::Signature* findCommand(::std::string const& name);
946
947 MCNAPI void fireCommandParseTableTelemetry(::IMinecraftEventing const& eventing, bool isServer) const;
948
949 MCNAPI void forEachNonTerminal(::std::function<void(::CommandRegistry::Symbol)> func) const;
950
951#ifdef LL_PLAT_S
952 MCNAPI ::Json::Value generateDocumentationMetadata(bool generateInternalMetadata) const;
953#endif
954
955 MCNAPI ::std::vector<::std::string> getAliases(::std::string const& command) const;
956
957 MCNAPI ::std::vector<::std::string> getAlphabeticalLookup(::CommandOrigin const& origin) const;
958
959#ifdef LL_PLAT_C
960 MCNAPI ::std::unique_ptr<::AutoCompleteInformation> getAutoCompleteOptions(
961 ::CommandOrigin const& origin,
962 ::std::string const& _cmdLine,
963 uint cursorPositionUnsafe
964 ) const;
965#endif
966
967 MCNAPI ::std::string getCommandName(::std::string const& commandLine) const;
968
969 MCAPI ::CommandSyntaxInformation
970 getCommandOverloadSyntaxInformation(::CommandOrigin const& origin, ::std::string const& commandName) const;
971
972 MCNAPI ::CommandStatus getCommandStatus(::std::string const& nameIn) const;
973
974 MCNAPI ::InvertableFilter<::std::string> getInvertableFilter(::CommandRegistry::ParseToken const& token) const;
975
976#ifdef LL_PLAT_C
977 MCNAPI ::CommandSyntaxInformation getOverloadSyntaxInformation(
978 ::CommandOrigin const& origin,
979 ::std::string const& cmdLine,
980 uint cursorPosition
981 ) const;
982#endif
983
984 MCNAPI bool isCommandOfType(::std::string const& nameIn, ::CommandTypeFlag commandType) const;
985
986 MCNAPI bool isValid(::CommandRegistry::Symbol symbol) const;
987
988#ifdef LL_PLAT_C
989 MCAPI void loadRemoteCommands(::AvailableCommandsPacket const& packet);
990#endif
991
992 MCNAPI bool originCanRun(::CommandOrigin const& origin, ::CommandRegistry::Signature const& command) const;
993
994#ifdef LL_PLAT_C
995 MCNAPI bool originCanRunOverloadWithParam(::CommandOrigin const& origin, ::CommandParameterData const& param) const;
996
997 MCNAPI ::std::string parsePartialCommand(
999 ::std::string const& _cmdLine,
1000 uint cursorPosition,
1001 bool cutLastToken
1002 ) const;
1003#endif
1004
1005 MCNAPI bool parseSelector(
1006 ::ActorSelectorArgs& args,
1007 ::CommandRegistry::ParseToken const& token,
1008 ::CommandOrigin const& origin,
1009 int version,
1010 ::std::string& error,
1011 ::std::vector<::std::string>& errorParams
1012 ) const;
1013
1014 MCNAPI bool parseSelector(
1015 ::CommandSelectorBase* output,
1016 ::CommandRegistry::ParseToken const& token,
1017 ::CommandOrigin const& origin,
1018 int version,
1019 ::std::string& error,
1020 ::std::vector<::std::string>& errorParams,
1021 bool wildcard
1022 ) const;
1023
1024#ifdef LL_PLAT_C
1025 MCNAPI void popState();
1026
1027 MCNAPI void pushState();
1028#endif
1029
1030 MCAPI void registerAlias(::std::string name, ::std::string alias);
1031
1032 MCAPI void registerCommand(
1033 ::std::string const& name,
1034 char const* description,
1035 ::CommandPermissionLevel requirement,
1036 ::CommandFlag f1,
1037 ::CommandFlag f2 = {}
1038 );
1039
1040#ifdef LL_PLAT_S
1041 MCNAPI void registerCommandFactory(
1042 char const* command,
1043 ::brstd::copyable_function<::std::unique_ptr<::Command>() const> createCommand
1044 );
1045#endif
1046
1047 MCAPI void registerOverload(
1048 char const* command,
1049 ::CommandVersion version,
1050 ::std::function<::std::unique_ptr<::Command>()> allocFn,
1051 ::std::vector<::CommandParameterData> params
1052 );
1053
1054 MCAPI void registerOverloadInternal(::CommandRegistry::Signature& signature, ::CommandRegistry::Overload& overload);
1055
1056 MCAPI void removeSoftEnumValues(::std::string const& enumName, ::std::vector<::std::string> values);
1057
1058 MCAPI ::AvailableCommandsPacket serializeAvailableCommands() const;
1059
1060 MCNAPI void setNetworkUpdateCallback(::std::function<void(::Packet const&)> callback);
1061
1062 MCNAPI void setScoreCallback(::std::function<int(bool&, ::std::string const&, ::Actor const&)> callback);
1063
1064 MCAPI void setSoftEnumValues(::std::string const& enumName, ::std::vector<::std::string> values);
1065
1067
1068#ifdef LL_PLAT_C
1069 MCNAPI void setupOverloadRules(::CommandRegistry::Signature& signature);
1070#endif
1071
1072 MCAPI ::std::string symbolToString(::CommandRegistry::Symbol symbol) const;
1073
1074 MCAPI ~CommandRegistry();
1075 // NOLINTEND
1076
1077public:
1078 // static functions
1079 // NOLINTBEGIN
1080#ifdef LL_PLAT_C
1081 MCNAPI static ::BlockType const* _getBlockFromCmdParameters(::std::string const& parameters);
1082#endif
1083
1084 MCAPI static ::std::string _removeStringQuotes(::std::string const& str);
1085
1086 MCNAPI static ::CommandRegistry::ParseToken*
1088
1089 MCNAPI static ::CommandRegistry::ParseToken* collapseOn(
1092 ::CommandRegistry::Symbol boundSymbol
1093 );
1094
1095 MCNAPI static ::CommandRegistry::ParseToken*
1097
1098 MCNAPI static ::CommandRegistry::ParseToken* expandExcept(
1101 ::CommandRegistry::Symbol boundSymbol
1102 );
1103
1104 MCNAPI static ::CommandRegistry::ParseToken* fold(
1107 ::CommandRegistry::Symbol boundSymbol
1108 );
1109
1110 MCNAPI static ::CommandRegistry::ParseToken*
1112
1113 MCNAPI static bool readFloat(
1114 float& value,
1115 ::CommandRegistry::ParseToken const& token,
1116 ::std::string& error,
1117 ::std::vector<::std::string>& errorParams
1118 );
1119
1120 MCNAPI static bool readInt(
1121 int& value,
1122 ::CommandRegistry::ParseToken const& token,
1123 ::std::string& error,
1124 ::std::vector<::std::string>& errorParams
1125 );
1126
1127 MCNAPI static bool readRelativeCoordinate(
1128 bool& relative,
1129 float& offset,
1130 ::CommandRegistry::ParseToken const& token,
1131 bool readIntegerAsCentered,
1132 ::std::string& error,
1133 ::std::vector<::std::string>& errorParams
1134 );
1135
1136 MCNAPI static bool readString(
1137 ::std::string& value,
1138 ::CommandRegistry::ParseToken const& token,
1139 ::std::string& error,
1140 ::std::vector<::std::string>& errorParams
1141 );
1142 // NOLINTEND
1143
1144public:
1145 // static variables
1146 // NOLINTBEGIN
1147 MCNAPI static char const*& CODE_STATUS_PROPERTY_NAME();
1148
1149 MCNAPI static char const*& COMMAND_NAME_ENUM_NAME();
1150
1151 MCNAPI static char const*& FUNCTION_NAME_SOFTENUM_NAME();
1152
1153 MCNAPI static char const*& POI_TAG_SOFTENUM();
1154
1155 MCNAPI static char const*& POI_TYPE_SOFTENUM();
1156
1157 MCNAPI static char const*& TAG_VALUES_SOFTENUM_NAME();
1158
1159 MCNAPI static char const*& UNLOCKABLE_RECIPES_SOFTENUM_NAME();
1160 // NOLINTEND
1161
1162public:
1163 // constructor thunks
1164 // NOLINTBEGIN
1165 MCAPI void* $ctor(::CommandRegistryArguments args);
1166 // NOLINTEND
1167
1168public:
1169 // destructor thunk
1170 // NOLINTBEGIN
1171 MCAPI void $dtor();
1172 // NOLINTEND
1173};
1174
1175// following are the functions required by CommandParameterData's ParseFunction
1176MCTAPI bool CommandRegistry::parse<std::string>(
1177 void*,
1179 CommandOrigin const&,
1180 int,
1181 std::string&,
1182 std::vector<std::string>&
1183) const;
1184
1185MCTAPI bool CommandRegistry::parse<int>(
1186 void*,
1188 CommandOrigin const&,
1189 int,
1190 std::string&,
1191 std::vector<std::string>&
1192) const;
1193
1194MCTAPI bool CommandRegistry::parse<float>(
1195 void*,
1197 CommandOrigin const&,
1198 int,
1199 std::string&,
1200 std::vector<std::string>&
1201) const;
1202
1203MCTAPI bool CommandRegistry::parse<Json::Value>(
1204 void*,
1206 CommandOrigin const&,
1207 int,
1208 std::string&,
1209 std::vector<std::string>&
1210) const;
1211
1212MCTAPI bool CommandRegistry::parse<CommandCompareOperator>(
1213 void*,
1215 CommandOrigin const&,
1216 int,
1217 std::string&,
1218 std::vector<std::string>&
1219) const;
1220
1221MCTAPI bool CommandRegistry::parse<CommandFilePath>(
1222 void*,
1224 CommandOrigin const&,
1225 int,
1226 std::string&,
1227 std::vector<std::string>&
1228) const;
1229
1230MCTAPI bool CommandRegistry::parse<CommandIntegerRange>(
1231 void*,
1233 CommandOrigin const&,
1234 int,
1235 std::string&,
1236 std::vector<std::string>&
1237) const;
1238
1239MCTAPI bool CommandRegistry::parse<CommandMessage>(
1240 void*,
1242 CommandOrigin const&,
1243 int,
1244 std::string&,
1245 std::vector<std::string>&
1246) const;
1247
1248MCTAPI bool CommandRegistry::parse<CommandOperator>(
1249 void*,
1251 CommandOrigin const&,
1252 int,
1253 std::string&,
1254 std::vector<std::string>&
1255) const;
1256
1257MCTAPI bool CommandRegistry::parse<CommandPosition>(
1258 void*,
1260 CommandOrigin const&,
1261 int,
1262 std::string&,
1263 std::vector<std::string>&
1264) const;
1265
1266MCTAPI bool CommandRegistry::parse<CommandPositionFloat>(
1267 void*,
1269 CommandOrigin const&,
1270 int,
1271 std::string&,
1272 std::vector<std::string>&
1273) const;
1274
1275MCTAPI bool CommandRegistry::parse<CommandRawText>(
1276 void*,
1278 CommandOrigin const&,
1279 int,
1280 std::string&,
1281 std::vector<std::string>&
1282) const;
1283
1284MCTAPI bool CommandRegistry::parse<CommandSelector<Actor>>(
1285 void*,
1287 CommandOrigin const&,
1288 int,
1289 std::string&,
1290 std::vector<std::string>&
1291) const;
1292
1293MCTAPI bool CommandRegistry::parse<CommandSelector<Player>>(
1294 void*,
1296 CommandOrigin const&,
1297 int,
1298 std::string&,
1299 std::vector<std::string>&
1300) const;
1301
1302MCTAPI bool CommandRegistry::parse<CommandWildcardInt>(
1303 void*,
1305 CommandOrigin const&,
1306 int,
1307 std::string&,
1308 std::vector<std::string>&
1309) const;
1310
1311MCTAPI bool CommandRegistry::parse<class RelativeFloat>(
1312 void*,
1314 CommandOrigin const&,
1315 int,
1316 std::string&,
1317 std::vector<std::string>&
1318) const;
1319
1320MCTAPI bool CommandRegistry::parse<WildcardCommandSelector<Actor>>(
1321 void*,
1323 CommandOrigin const&,
1324 int,
1325 std::string&,
1326 std::vector<std::string>&
1327) const;
1328
1329MCTAPI bool CommandRegistry::parse<std::unique_ptr<::Command>>(
1330 void*,
1332 CommandOrigin const&,
1333 int,
1334 std::string&,
1335 std::vector<std::string>&
1336) const;
1337
1338MCTAPI bool CommandRegistry::parse<std::vector<BlockStateCommandParam>>(
1339 void*,
1341 CommandOrigin const&,
1342 int,
1343 std::string&,
1344 std::vector<std::string>&
1345) const;
1346
1347MCTAPI bool CommandRegistry::parseEnum<CommandChainedSubcommand, void>(
1348 void*,
1350 CommandOrigin const&,
1351 int,
1352 std::string&,
1353 std::vector<std::string>&
1354) const;
1355
1356// clang-format off
1357template <>
1358MCAPI ::ll::type_id_ref Bedrock::typeid_storage_impl<class CommandRegistry, ::std::basic_string<char, ::std::char_traits<char>, ::std::allocator<char> >>();
1359template <>
1360MCAPI ::ll::type_id_ref Bedrock::typeid_storage_impl<class CommandRegistry, bool>();
1361template <>
1362MCAPI ::ll::type_id_ref Bedrock::typeid_storage_impl<class CommandRegistry, float>();
1363template <>
1364MCAPI ::ll::type_id_ref Bedrock::typeid_storage_impl<class CommandRegistry, int>();
1365// clang-format on
Definition Actor.h:116
Definition AvailableCommandsPacket.h:19
Definition typeid_t.h:36
Definition BlockState.h:14
Definition BlockType.h:79
Definition CommandOrigin.h:32
Definition CommandParameterData.h:18
Definition CommandRegistry.h:549
MCAPI bool parseSelector(::std::string const &in)
MCAPI bool _parse(::std::string const &in)
MCAPI ::std::vector<::std::string > getErrorParams() const
MCAPI ::std::unique_ptr<::CommandSelector<::Actor > > createSelector(::std::string const &selectorString, ::CommandOrigin const &origin)
Definition CommandRegistry.h:246
MCAPI::CommandRegistry::Symbol _addEnumValuesInternal(::std::string const &name, ::std::vector<::std::pair< uint64, uint64 > > const &values, ::Bedrock::typeid_t<::CommandRegistry > type, bool(::CommandRegistry::*parse)(void *, ::CommandRegistry::ParseToken const &, ::CommandOrigin const &, int, ::std::string &, ::std::vector<::std::string > &) const)
static MCAPI bool readInt(int &value, ::CommandRegistry::ParseToken const &token, ::std::string &error, ::std::vector<::std::string > &errorParams)
static MCAPI ::CommandRegistry::ParseToken * expand(::CommandRegistry::ParseToken &parent, ::CommandRegistry::Symbol symbol)
MCAPI ::InvertableFilter<::std::string > getInvertableFilter(::CommandRegistry::ParseToken const &token) const
MCAPI void buildFirstSet(::CommandRegistry::ParseTable &table, ::CommandRegistry::Symbol t, uint version) const
MCAPI::CommandRegistry::Symbol buildRules(::CommandRegistry::Signature &signature, ::std::vector<::gsl::not_null<::CommandRegistry::Overload * > > const &overloads, uint64 firstParam)
MCAPI::std::string getCommandName(::std::string const &commandLine) const
static MCAPI bool readRelativeCoordinate(bool &relative, float &offset, ::CommandRegistry::ParseToken const &token, bool readIntegerAsCentered, ::std::string &error, ::std::vector<::std::string > &errorParams)
static MCAPI bool readString(::std::string &value, ::CommandRegistry::ParseToken const &token, ::std::string &error, ::std::vector<::std::string > &errorParams)
static MCAPI ::CommandRegistry::ParseToken * collapseOn(::CommandRegistry::ParseToken &parent, ::CommandRegistry::Symbol symbol, ::CommandRegistry::Symbol boundSymbol)
static MCAPI char const *& POI_TYPE_SOFTENUM()
MCAPI ::std::vector<::std::string > getAlphabeticalLookup(::CommandOrigin const &origin) const
static MCAPI char const *& CODE_STATUS_PROPERTY_NAME()
MCAPI void forEachNonTerminal(::std::function< void(::CommandRegistry::Symbol)> func) const
MCAPI::CommandRegistry::Symbol addSoftTerminal(::std::string const &name)
static MCAPI char const *& POI_TAG_SOFTENUM()
MCAPI void buildFollowSet(::CommandRegistry::ParseTable &table, ::CommandRegistry::Symbol t, uint version, ::std::set<::CommandRegistry::Symbol > &workingSet) const
MCAPI void setupChainedSubcommandOverloadRules(::CommandRegistry::Signature &signature)
MCAPI bool isValid(::CommandRegistry::Symbol symbol) const
static MCAPI bool readFloat(float &value, ::CommandRegistry::ParseToken const &token, ::std::string &error, ::std::vector<::std::string > &errorParams)
MCAPI void addEnumValuesToExisting(uint index, ::std::vector<::std::pair< uint64, uint64 > > const &values)
static MCAPI char const *& FUNCTION_NAME_SOFTENUM_NAME()
static MCAPI char const *& TAG_VALUES_SOFTENUM_NAME()
MCAPI void setScoreCallback(::std::function< int(bool &, ::std::string const &, ::Actor const &)> callback)
MCAPI::CommandRegistry::Symbol _addChainedSubcommandValuesInternal(::std::string const &name, ::std::vector<::std::pair<::std::string, uint > > const &strings, ::Bedrock::typeid_t<::CommandRegistry > type, bool(CommandRegistry::*parse)(void *, ::CommandRegistry::ParseToken const &, ::CommandOrigin const &, int, ::std::string &, ::std::vector<::std::string > &) const, ::CommandRegistry::Signature *signature)
MCAPI void addRule(::CommandRegistry::Symbol symbol, ::std::vector<::CommandRegistry::Symbol > derivation, ::std::function<::CommandRegistry::ParseToken *(::CommandRegistry::ParseToken &, ::CommandRegistry::Symbol)> process, ::CommandVersion versions)
static MCAPI ::CommandRegistry::ParseToken * expandExcept(::CommandRegistry::ParseToken &parent, ::CommandRegistry::Symbol symbol, ::CommandRegistry::Symbol boundSymbol)
MCAPI void addSemanticConstraint(::SemanticConstraint constraintType)
static MCAPI char const *& UNLOCKABLE_RECIPES_SOFTENUM_NAME()
MCAPI ::std::unique_ptr<::Command > createCommand(::CommandRegistry::ParseToken const &root, ::CommandOrigin const &origin, int version, ::std::string &error, ::std::vector<::std::string > &errorParams) const
MCAPI bool parseSelector(::ActorSelectorArgs &args, ::CommandRegistry::ParseToken const &token, ::CommandOrigin const &origin, int version, ::std::string &error, ::std::vector<::std::string > &errorParams) const
MCAPI bool originCanRun(::CommandOrigin const &origin, ::CommandRegistry::Signature const &command) const
MCAPI void finalizeChainedSubcommandOverloadRules(char const *command)
MCAPI::CommandRegistry::Signature const * findCommand(::std::string const &name) const
static MCAPI ::CommandRegistry::ParseToken * collapse(::CommandRegistry::ParseToken &parent, ::CommandRegistry::Symbol symbol)
MCAPI void setNetworkUpdateCallback(::std::function< void(::Packet const &)> callback)
static MCAPI ::CommandRegistry::ParseToken * fold(::CommandRegistry::ParseToken &parent, ::CommandRegistry::Symbol symbol, ::CommandRegistry::Symbol boundSymbol)
MCAPI void fireCommandParseTableTelemetry(::IMinecraftEventing const &eventing, bool isServer) const
MCAPI bool buildSelector(::ActorSelectorArgs const &args, ::CommandSelectorBase *output, ::std::string &error) const
MCAPI ::std::vector<::std::string > getAliases(::std::string const &command) const
MCAPI bool isCommandOfType(::std::string const &nameIn, ::CommandTypeFlag commandType) const
MCAPI bool _matchesEnumConstraintsSet(::CommandRegistry::Symbol const &commandParamSymbol, ::CommandOrigin const &origin, ::CommandRegistry::Symbol const &value, ::SemanticConstraint requiredConstraints) const
MCAPI::CommandStatus getCommandStatus(::std::string const &nameIn) const
static MCAPI char const *& COMMAND_NAME_ENUM_NAME()
MCAPI ::std::unique_ptr<::CommandSelector<::Actor > > _createSelector(::CommandRegistry::ParseToken const &root, ::CommandOrigin const &origin, int version, ::std::string &error, ::std::vector<::std::string > &errorParams) const
static MCAPI ::CommandRegistry::ParseToken * kill(::CommandRegistry::ParseToken &parent, ::CommandRegistry::Symbol symbol)
MCAPI bool parseSelector(::CommandSelectorBase *output, ::CommandRegistry::ParseToken const &token, ::CommandOrigin const &origin, int version, ::std::string &error, ::std::vector<::std::string > &errorParams, bool wildcard) const
Definition CommandRunStats.h:8
Definition CommandSelectorBase.h:24
Definition CommandVersion.h:10
Definition Command.h:17
Definition IMinecraftEventing.h:152
Definition Value.h:16
Definition Packet.h:29
Definition PlayerListEntry.h:17
Definition copyable_function.h:8
Definition ActorSelectorArgs.h:21
Definition AutoCompleteInformation.h:10
Definition CommandFlag.h:43
Definition CommandLexer.h:50
Definition CommandRegistryArguments.h:14
Definition CommandRegistry.h:407
Definition CommandRegistry.h:279
Definition CommandRegistry.h:418
Definition CommandRegistry.h:289
Definition CommandRegistry.h:297
MCAPI::CommandRegistry::LexicalToken & operator=(::CommandLexer::Token const &token)
Definition CommandRegistry.h:321
Definition CommandRegistry.h:331
Definition CommandRegistry.h:429
Definition CommandRegistry.h:348
Definition CommandRegistry.h:747
Definition CommandRegistry.h:449
MCAPI::CommandRegistry::ParseRule & operator=(::CommandRegistry::ParseRule &&rhs)
Definition CommandRegistry.h:524
Definition CommandRegistry.h:380
Definition CommandRegistry.h:186
Definition CommandRegistry.h:476
Definition CommandRegistry.h:488
Definition CommandRegistry.h:221
MCAPI SoftEnum(::std::string const &name, ::std::vector<::std::string > values)
MCAPI void * $ctor(::std::string const &name, ::std::vector<::std::string > values)
Definition CommandRegistry.h:520
Definition CommandRegistry.h:522
Definition CommandSyntaxInformation.h:10