Package net.minecraft.command.arguments
Class EntitySelectorParser
- java.lang.Object
-
- net.minecraft.command.arguments.EntitySelectorParser
-
public class EntitySelectorParser extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
allowSelectors
private boolean
currentEntity
private java.lang.Double
deltaX
private java.lang.Double
deltaY
private java.lang.Double
deltaZ
private MinMaxBounds.FloatBound
distance
private java.util.UUID
entityUUID
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_EXPECTED_END_OF_OPTIONS
static com.mojang.brigadier.exceptions.DynamicCommandExceptionType
ERROR_EXPECTED_OPTION_VALUE
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_INVALID_NAME_OR_UUID
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_MISSING_SELECTOR_TYPE
static com.mojang.brigadier.exceptions.SimpleCommandExceptionType
ERROR_SELECTORS_NOT_ALLOWED
static com.mojang.brigadier.exceptions.DynamicCommandExceptionType
ERROR_UNKNOWN_SELECTOR_TYPE
private boolean
hasAdvancements
private boolean
hasGamemodeEquals
private boolean
hasGamemodeNotEquals
private boolean
hasNameEquals
private boolean
hasNameNotEquals
private boolean
hasScores
private boolean
hasTeamEquals
private boolean
hasTeamNotEquals
private boolean
includesEntities
private boolean
isLimited
private boolean
isSorted
private MinMaxBounds.IntBound
level
private int
maxResults
private java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>>
order
static java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>>
ORDER_ARBITRARY
static java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>>
ORDER_FURTHEST
static java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>>
ORDER_NEAREST
static java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>>
ORDER_RANDOM
private java.lang.String
playerName
private java.util.function.Predicate<Entity>
predicate
private com.mojang.brigadier.StringReader
reader
private MinMaxBoundsWrapped
rotX
private MinMaxBoundsWrapped
rotY
private int
startPosition
static java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>>
SUGGEST_NOTHING
private java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>>
suggestions
private EntityType<?>
type
private boolean
typeInverse
private boolean
usesSelectors
private boolean
worldLimited
private java.lang.Double
x
private java.lang.Double
y
private java.lang.Double
z
-
Constructor Summary
Constructors Constructor Description EntitySelectorParser(com.mojang.brigadier.StringReader p_i47958_1_)
EntitySelectorParser(com.mojang.brigadier.StringReader p_i49550_1_, boolean p_i49550_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPredicate(java.util.function.Predicate<Entity> p_197401_1_)
private AxisAlignedBB
createAabb(double p_197390_1_, double p_197390_3_, double p_197390_5_)
private java.util.function.Predicate<Entity>
createRotationPredicate(MinMaxBoundsWrapped p_197366_1_, java.util.function.ToDoubleFunction<Entity> p_197366_2_)
private static void
fillSelectorSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_210326_0_)
java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
fillSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201993_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201993_2_)
void
finalizePredicates()
java.lang.Double
getDeltaX()
java.lang.Double
getDeltaY()
java.lang.Double
getDeltaZ()
MinMaxBounds.FloatBound
getDistance()
MinMaxBounds.IntBound
getLevel()
com.mojang.brigadier.StringReader
getReader()
MinMaxBoundsWrapped
getRotX()
MinMaxBoundsWrapped
getRotY()
EntitySelector
getSelector()
java.lang.Double
getX()
java.lang.Double
getY()
java.lang.Double
getZ()
boolean
hasAdvancements()
boolean
hasGamemodeEquals()
boolean
hasGamemodeNotEquals()
boolean
hasNameEquals()
boolean
hasNameNotEquals()
boolean
hasScores()
boolean
hasTeamEquals()
boolean
isCurrentEntity()
boolean
isLimited()
boolean
isSorted()
boolean
isTag()
boolean
isTypeLimited()
boolean
isTypeLimitedInversely()
void
limitToType(EntityType<?> p_218114_1_)
EntitySelector
parse()
protected void
parseNameOrUUID()
void
parseOptions()
protected void
parseSelector()
void
setDeltaX(double p_197377_1_)
void
setDeltaY(double p_197391_1_)
void
setDeltaZ(double p_197405_1_)
void
setDistance(MinMaxBounds.FloatBound p_197397_1_)
void
setHasAdvancements(boolean p_201992_1_)
void
setHasGamemodeEquals(boolean p_201988_1_)
void
setHasGamemodeNotEquals(boolean p_201973_1_)
void
setHasNameEquals(boolean p_201990_1_)
void
setHasNameNotEquals(boolean p_201998_1_)
void
setHasScores(boolean p_201970_1_)
void
setHasTeamEquals(boolean p_201975_1_)
void
setHasTeamNotEquals(boolean p_201958_1_)
void
setIncludesEntities(boolean p_197373_1_)
void
setLevel(MinMaxBounds.IntBound p_197399_1_)
void
setLimited(boolean p_201979_1_)
void
setMaxResults(int p_197388_1_)
void
setOrder(java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>> p_197376_1_)
void
setRotX(MinMaxBoundsWrapped p_197389_1_)
void
setRotY(MinMaxBoundsWrapped p_197387_1_)
void
setSorted(boolean p_201986_1_)
void
setSuggestions(java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> p_201978_1_)
void
setTypeLimitedInversely()
void
setWorldLimited()
void
setX(double p_197384_1_)
void
setY(double p_197395_1_)
void
setZ(double p_197372_1_)
boolean
shouldInvertValue()
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201974_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201974_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestNameOrSelector(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201981_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201981_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestOpenOptions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201989_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201989_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestOptionsKey(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201994_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201994_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestOptionsKeyOrClose(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201996_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201996_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestOptionsNextOrClose(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201969_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201969_2_)
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestSelector(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201959_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201959_2_)
-
-
-
Field Detail
-
ERROR_INVALID_NAME_OR_UUID
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INVALID_NAME_OR_UUID
-
ERROR_UNKNOWN_SELECTOR_TYPE
public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_SELECTOR_TYPE
-
ERROR_SELECTORS_NOT_ALLOWED
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_SELECTORS_NOT_ALLOWED
-
ERROR_MISSING_SELECTOR_TYPE
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_MISSING_SELECTOR_TYPE
-
ERROR_EXPECTED_END_OF_OPTIONS
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_EXPECTED_END_OF_OPTIONS
-
ERROR_EXPECTED_OPTION_VALUE
public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_EXPECTED_OPTION_VALUE
-
ORDER_ARBITRARY
public static final java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>> ORDER_ARBITRARY
-
ORDER_NEAREST
public static final java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>> ORDER_NEAREST
-
ORDER_FURTHEST
public static final java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>> ORDER_FURTHEST
-
ORDER_RANDOM
public static final java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>> ORDER_RANDOM
-
SUGGEST_NOTHING
public static final java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> SUGGEST_NOTHING
-
reader
private final com.mojang.brigadier.StringReader reader
-
allowSelectors
private final boolean allowSelectors
-
maxResults
private int maxResults
-
includesEntities
private boolean includesEntities
-
worldLimited
private boolean worldLimited
-
distance
private MinMaxBounds.FloatBound distance
-
level
private MinMaxBounds.IntBound level
-
x
@Nullable private java.lang.Double x
-
y
@Nullable private java.lang.Double y
-
z
@Nullable private java.lang.Double z
-
deltaX
@Nullable private java.lang.Double deltaX
-
deltaY
@Nullable private java.lang.Double deltaY
-
deltaZ
@Nullable private java.lang.Double deltaZ
-
rotX
private MinMaxBoundsWrapped rotX
-
rotY
private MinMaxBoundsWrapped rotY
-
predicate
private java.util.function.Predicate<Entity> predicate
-
currentEntity
private boolean currentEntity
-
playerName
@Nullable private java.lang.String playerName
-
startPosition
private int startPosition
-
entityUUID
@Nullable private java.util.UUID entityUUID
-
suggestions
private java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions
-
hasNameEquals
private boolean hasNameEquals
-
hasNameNotEquals
private boolean hasNameNotEquals
-
isLimited
private boolean isLimited
-
isSorted
private boolean isSorted
-
hasGamemodeEquals
private boolean hasGamemodeEquals
-
hasGamemodeNotEquals
private boolean hasGamemodeNotEquals
-
hasTeamEquals
private boolean hasTeamEquals
-
hasTeamNotEquals
private boolean hasTeamNotEquals
-
type
@Nullable private EntityType<?> type
-
typeInverse
private boolean typeInverse
-
hasScores
private boolean hasScores
-
hasAdvancements
private boolean hasAdvancements
-
usesSelectors
private boolean usesSelectors
-
-
Method Detail
-
getSelector
public EntitySelector getSelector()
-
createAabb
private AxisAlignedBB createAabb(double p_197390_1_, double p_197390_3_, double p_197390_5_)
-
finalizePredicates
public void finalizePredicates()
-
createRotationPredicate
private java.util.function.Predicate<Entity> createRotationPredicate(MinMaxBoundsWrapped p_197366_1_, java.util.function.ToDoubleFunction<Entity> p_197366_2_)
-
parseSelector
protected void parseSelector() throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseNameOrUUID
protected void parseNameOrUUID() throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseOptions
public void parseOptions() throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
shouldInvertValue
public boolean shouldInvertValue()
-
isTag
public boolean isTag()
-
getReader
public com.mojang.brigadier.StringReader getReader()
-
addPredicate
public void addPredicate(java.util.function.Predicate<Entity> p_197401_1_)
-
setWorldLimited
public void setWorldLimited()
-
getDistance
public MinMaxBounds.FloatBound getDistance()
-
setDistance
public void setDistance(MinMaxBounds.FloatBound p_197397_1_)
-
getLevel
public MinMaxBounds.IntBound getLevel()
-
setLevel
public void setLevel(MinMaxBounds.IntBound p_197399_1_)
-
getRotX
public MinMaxBoundsWrapped getRotX()
-
setRotX
public void setRotX(MinMaxBoundsWrapped p_197389_1_)
-
getRotY
public MinMaxBoundsWrapped getRotY()
-
setRotY
public void setRotY(MinMaxBoundsWrapped p_197387_1_)
-
getX
@Nullable public java.lang.Double getX()
-
getY
@Nullable public java.lang.Double getY()
-
getZ
@Nullable public java.lang.Double getZ()
-
setX
public void setX(double p_197384_1_)
-
setY
public void setY(double p_197395_1_)
-
setZ
public void setZ(double p_197372_1_)
-
setDeltaX
public void setDeltaX(double p_197377_1_)
-
setDeltaY
public void setDeltaY(double p_197391_1_)
-
setDeltaZ
public void setDeltaZ(double p_197405_1_)
-
getDeltaX
@Nullable public java.lang.Double getDeltaX()
-
getDeltaY
@Nullable public java.lang.Double getDeltaY()
-
getDeltaZ
@Nullable public java.lang.Double getDeltaZ()
-
setMaxResults
public void setMaxResults(int p_197388_1_)
-
setIncludesEntities
public void setIncludesEntities(boolean p_197373_1_)
-
setOrder
public void setOrder(java.util.function.BiConsumer<Vector3d,java.util.List<? extends Entity>> p_197376_1_)
-
parse
public EntitySelector parse() throws com.mojang.brigadier.exceptions.CommandSyntaxException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
fillSelectorSuggestions
private static void fillSelectorSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_210326_0_)
-
suggestNameOrSelector
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestNameOrSelector(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201981_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201981_2_)
-
suggestName
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestName(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201974_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201974_2_)
-
suggestSelector
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestSelector(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201959_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201959_2_)
-
suggestOpenOptions
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenOptions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201989_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201989_2_)
-
suggestOptionsKeyOrClose
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOptionsKeyOrClose(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201996_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201996_2_)
-
suggestOptionsKey
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOptionsKey(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201994_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201994_2_)
-
suggestOptionsNextOrClose
private java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOptionsNextOrClose(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201969_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201969_2_)
-
isCurrentEntity
public boolean isCurrentEntity()
-
setSuggestions
public void setSuggestions(java.util.function.BiFunction<com.mojang.brigadier.suggestion.SuggestionsBuilder,java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder>,java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> p_201978_1_)
-
fillSuggestions
public java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> fillSuggestions(com.mojang.brigadier.suggestion.SuggestionsBuilder p_201993_1_, java.util.function.Consumer<com.mojang.brigadier.suggestion.SuggestionsBuilder> p_201993_2_)
-
hasNameEquals
public boolean hasNameEquals()
-
setHasNameEquals
public void setHasNameEquals(boolean p_201990_1_)
-
hasNameNotEquals
public boolean hasNameNotEquals()
-
setHasNameNotEquals
public void setHasNameNotEquals(boolean p_201998_1_)
-
isLimited
public boolean isLimited()
-
setLimited
public void setLimited(boolean p_201979_1_)
-
isSorted
public boolean isSorted()
-
setSorted
public void setSorted(boolean p_201986_1_)
-
hasGamemodeEquals
public boolean hasGamemodeEquals()
-
setHasGamemodeEquals
public void setHasGamemodeEquals(boolean p_201988_1_)
-
hasGamemodeNotEquals
public boolean hasGamemodeNotEquals()
-
setHasGamemodeNotEquals
public void setHasGamemodeNotEquals(boolean p_201973_1_)
-
hasTeamEquals
public boolean hasTeamEquals()
-
setHasTeamEquals
public void setHasTeamEquals(boolean p_201975_1_)
-
setHasTeamNotEquals
public void setHasTeamNotEquals(boolean p_201958_1_)
-
limitToType
public void limitToType(EntityType<?> p_218114_1_)
-
setTypeLimitedInversely
public void setTypeLimitedInversely()
-
isTypeLimited
public boolean isTypeLimited()
-
isTypeLimitedInversely
public boolean isTypeLimitedInversely()
-
hasScores
public boolean hasScores()
-
setHasScores
public void setHasScores(boolean p_201970_1_)
-
hasAdvancements
public boolean hasAdvancements()
-
setHasAdvancements
public void setHasAdvancements(boolean p_201992_1_)
-
-