You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Making a custom parser that accepts a subtype of your sender type (in my case org.bukkit.entity.Player of org.bukkit.command.CommandSender) is very useful as to automatically utilize existing error infrastructure (specifically the TerminalConsoleCommandSender is not allowed to execute that command. Must be of type Player message).
Currently, the existing ParserRegistry#registerParser(ParserDescriptor) method does not allow type narrowing and requires an unchecked cast to allow it to compile.
Making a custom parser that accepts a subtype of your sender type (in my case
org.bukkit.entity.Player
oforg.bukkit.command.CommandSender
) is very useful as to automatically utilize existing error infrastructure (specifically theTerminalConsoleCommandSender is not allowed to execute that command. Must be of type Player
message).Currently, the existing
ParserRegistry#registerParser(ParserDescriptor)
method does not allow type narrowing and requires an unchecked cast to allow it to compile.Example in Kotlin:
I was told by @jpenilla that there could be a method added that gives a view of the parser registry for subtypes specifically, so that this can be validated correctly. Here is the Discord message where this was mentioned.
The text was updated successfully, but these errors were encountered: