Skip to content

Commit 99aa5f2

Browse files
committed
Fixes parsing tags in selectors in command functions
Fixes #7928
1 parent 698b315 commit 99aa5f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

patches/server/0814-Fix-entity-type-tags-suggestions-in-selectors.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ index ad99d67af92cda03beb1142b02082ee1bfc8a64a..a57ae219d57ed47baedfb73b3d815f39
9797
this.level = MinMaxBounds.Ints.ANY;
9898
this.rotX = WrappedMinMaxBounds.ANY;
9999
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
100-
index c2b26a089c423e5df9a5cbfd1c70efbd1acb0e7a..4200ce431e07aa3e6d05702d184ad85b4fef01a8 100644
100+
index c2b26a089c423e5df9a5cbfd1c70efbd1acb0e7a..f2376374c4c6efdfd5cfcea4d30c4b8b4dbbb0d5 100644
101101
--- a/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
102102
+++ b/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
103103
@@ -67,6 +67,19 @@ public class EntitySelectorOptions {
@@ -125,7 +125,7 @@ index c2b26a089c423e5df9a5cbfd1c70efbd1acb0e7a..4200ce431e07aa3e6d05702d184ad85b
125125
if (reader.isTag()) {
126126
TagKey<EntityType<?>> tagKey = TagKey.create(Registry.ENTITY_TYPE_REGISTRY, ResourceLocation.read(reader.getReader()));
127127
+ // Paper start - throw error if invalid entity tag (only on suggestions to keep cmd success behavior)
128-
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().commands.fixTargetSelectorTagCompletion && reader.parsingEntityArgumentSuggestions && !Registry.ENTITY_TYPE.isKnownTagName(tagKey)) {
128+
+ if (reader.parsingEntityArgumentSuggestions && io.papermc.paper.configuration.GlobalConfiguration.get().commands.fixTargetSelectorTagCompletion && !Registry.ENTITY_TYPE.isKnownTagName(tagKey)) {
129129
+ reader.getReader().setCursor(i);
130130
+ throw ERROR_ENTITY_TAG_INVALID.createWithContext(reader.getReader(), tagKey);
131131
+ }

0 commit comments

Comments
 (0)