serenity
serenity copied to clipboard
feat: Strict custom enum type support.
Description
Serenity does not currently support strict ("real") enum support. By this, I refer to an enum type that meets the following qualifications:
- Registered as a new param type in commands (e.g.
/setblock <block: BlockId>vs current/setblock <block: string>. - Validates from a list of string options.
Not having strict enum support creates one critical issue with the command system: If you have two overloads that use different enums, for example:
/test <foo: "foo"> <bar: "bar"> /test <test: "hello" | "world>
The client will always choose the second enum. This is because all CustomEnums use the string symbol, which offers no client differentiation between "foo" and "hello" | "world".
Without this feature, overloads will never function as expected, making the command system a lot less versatile and useful.