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
rather than expecting the names "EASY", "PEACEFUL" etc., it at first seems like it's actually expecting options.difficulty.easy, options.difficulty.peaceful, etc.
However, when control then passes to getValue(String), here we find thatSponge.getGame().getRegistry().getType(this.catalogType, choice); fails to find anything, because choice here is not expecting options.difficulty.easy, but EASY, so no match can ever be made.
Using the latest SpongeVanilla, where the last argument of the command is the difficulty, I find this happens, first for normal, then for options.difficulty.normal:
[18:12:30 INFO] [nucleus]: Server ran the command: /world create test overworld flat survival normal
[18:12:30 INFO]: No values matching pattern 'normal' present for difficulty!
create test overworld flat survival normal
^
[18:12:30 INFO]: Usage: /world setdifficulty|teleport|setgamemode|list|delete|setspawn|spawn|load|create
> world create test overworld flat survival options.difficulty.normal
[18:12:32 INFO] [nucleus]: Server ran the command: /world create test overworld flat survival options.difficulty.normal
[18:12:32 INFO]: Error occurred while executing command: Invalid input options.difficulty.normal was found
[18:12:32 ERROR] [Sponge]: Error occurred while executing command 'world create test overworld flat survival options.difficulty.normal' for source DedicatedServer: Invalid input options.difficulty.normal was found
java.lang.IllegalArgumentException: Invalid input options.difficulty.normal was found
at org.spongepowered.api.command.args.GenericArguments$CatalogedTypeCommandElement.getValue(GenericArguments.java:1340) ~[GenericArguments$CatalogedTypeCommandElement.class:1.8.9-4.1.0-BETA-314]
at org.spongepowered.api.command.args.PatternMatchingCommandElement.parseValue(PatternMatchingCommandElement.java:59) ~[PatternMatchingCommandElement.class:1.8.9-4.1.0-BETA-314]
at org.spongepowered.api.command.args.CommandElement.parse(CommandElement.java:83) ~[CommandElement.class:1.8.9-4.1.0-BETA-314]
The text was updated successfully, but these errors were encountered:
[ERROR]: Failed to obtain instance for Difficulty with id options.difficulty.normal
[ERROR]: Failed to obtain instance for Difficulty with id options.difficulty.hard
[ERROR]: Failed to obtain instance for Difficulty with id options.difficulty.easy
[ERROR]: Failed to obtain instance for Difficulty with id options.difficulty.peaceful
Currently, the
CatalogedTypeCommandElement
tries to make a match with the ID of the catalogued type (using.getId()
) as seen here ingetChoices(CommandSource)
in the GenericArguments class.In the case of
rather than expecting the names "EASY", "PEACEFUL" etc., it at first seems like it's actually expecting
options.difficulty.easy
,options.difficulty.peaceful
, etc.However, when control then passes to
getValue(String)
, here we find thatSponge.getGame().getRegistry().getType(this.catalogType, choice);
fails to find anything, becausechoice
here is not expectingoptions.difficulty.easy
, butEASY
, so no match can ever be made.Using the latest SpongeVanilla, where the last argument of the command is the difficulty, I find this happens, first for
normal
, then foroptions.difficulty.normal
:The text was updated successfully, but these errors were encountered: