-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OptionalArg don't support collections types #378
Comments
This is how it currently works only indirectly to be able to better manage suggestions. LiteCommands -> List suggester -> GameMode suggester |
Currently, when providing for the class type of the object in the collection, and not providing for the collection class results in an error. As an example, I changed to using ArgumentKey as suggested in #377 and it errors out when it gets to the List argument. java.lang.IllegalArgumentException: No parser found for argument List
at phantomworlds.libs.lc.litecommands.argument.parser.ParserSet.getValidParserOrThrow(ParserSet.java:17) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.input.raw.RawInputAnalyzer.isNextOptional(RawInputAnalyzer.java:63) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.argument.suggester.input.SuggestionInputRawImpl$Matcher.isNextOptional(SuggestionInputRawImpl.java:71) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.suggestion.SuggestionService.suggestArgument(SuggestionService.java:109) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.suggestion.SuggestionService.suggestExecutor(SuggestionService.java:87) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.suggestion.SuggestionService.suggest0(SuggestionService.java:55) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.suggestion.SuggestionService.suggest(SuggestionService.java:34) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.command.CommandManager$PlatformListener.suggest(CommandManager.java:71) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.bukkit.BukkitCommand.suggest(BukkitCommand.java:82) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.bukkit.TabComplete.callListener(TabComplete.java:65) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.bukkit.TabCompletePaperAsync.executeListener(TabCompletePaperAsync.java:25) ~[PhantomWorlds-2.0.5.jar:?]
at phantomworlds.libs.lc.litecommands.bukkit.TabCompletePaperAsync.lambda$new$0(TabCompletePaperAsync.java:20) ~[PhantomWorlds-2.0.5.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:git-Purpur-2092]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.2.jar:git-Purpur-2092]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.2.jar:git-Purpur-2092]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.event.Event.callEvent(Event.java:45) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleCustomCommandSuggestions$7(ServerGamePacketListenerImpl.java:822) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.lang.Thread.run(Thread.java:1623) ~[?:?] Code to register argument parser: .argument(String.class, ArgumentKey.of("world-setting"), new SettingParameterRedux()) |
I cannot reproduce this issue. You can see how use |
Seems to be the case with OptionalArg throwing the error. Thank You, |
This is a suggestion to change what class file LiteCommands looks for when it comes to collections. I think instead of checking for a suggestion on List.class, it should instead check the class of the objects the List contains. Example List should look for completion based on GameMode.class not List.class.
The text was updated successfully, but these errors were encountered: