Fixes parsing tags in selectors in command functions

Fixes #7928
This commit is contained in:
Jake Potrebic 2022-06-10 10:02:04 -07:00
parent 43f46a5f0b
commit e44a2dc4ac

View File

@ -125,7 +125,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (reader.isTag()) {
TagKey<EntityType<?>> tagKey = TagKey.create(Registry.ENTITY_TYPE_REGISTRY, ResourceLocation.read(reader.getReader()));
+ // Paper start - throw error if invalid entity tag (only on suggestions to keep cmd success behavior)
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().commands.fixTargetSelectorTagCompletion && reader.parsingEntityArgumentSuggestions && !Registry.ENTITY_TYPE.isKnownTagName(tagKey)) {
+ if (reader.parsingEntityArgumentSuggestions && io.papermc.paper.configuration.GlobalConfiguration.get().commands.fixTargetSelectorTagCompletion && !Registry.ENTITY_TYPE.isKnownTagName(tagKey)) {
+ reader.getReader().setCursor(i);
+ throw ERROR_ENTITY_TAG_INVALID.createWithContext(reader.getReader(), tagKey);
+ }