From 99aa5f2fa57ccc17f936d51097d2b01504aa72dd Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 10 Jun 2022 10:02:04 -0700 Subject: [PATCH] Fixes parsing tags in selectors in command functions Fixes #7928 --- .../0814-Fix-entity-type-tags-suggestions-in-selectors.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0814-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/0814-Fix-entity-type-tags-suggestions-in-selectors.patch index c0d3ac45aa..bc2b04963d 100644 --- a/patches/server/0814-Fix-entity-type-tags-suggestions-in-selectors.patch +++ b/patches/server/0814-Fix-entity-type-tags-suggestions-in-selectors.patch @@ -97,7 +97,7 @@ index ad99d67af92cda03beb1142b02082ee1bfc8a64a..a57ae219d57ed47baedfb73b3d815f39 this.level = MinMaxBounds.Ints.ANY; this.rotX = WrappedMinMaxBounds.ANY; diff --git a/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java b/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java -index c2b26a089c423e5df9a5cbfd1c70efbd1acb0e7a..4200ce431e07aa3e6d05702d184ad85b4fef01a8 100644 +index c2b26a089c423e5df9a5cbfd1c70efbd1acb0e7a..f2376374c4c6efdfd5cfcea4d30c4b8b4dbbb0d5 100644 --- a/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java +++ b/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java @@ -67,6 +67,19 @@ public class EntitySelectorOptions { @@ -125,7 +125,7 @@ index c2b26a089c423e5df9a5cbfd1c70efbd1acb0e7a..4200ce431e07aa3e6d05702d184ad85b if (reader.isTag()) { TagKey> 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); + }