Record Class PlayerPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.PlayerPredicate
- All Implemented Interfaces:
EntitySubPredicate
public record PlayerPredicate(MinMaxBounds.Ints level, GameTypePredicate gameType, List<PlayerPredicate.StatMatcher<?>> stats, it.unimi.dsi.fastutil.objects.Object2BooleanMap<ResourceLocation> recipes, Map<ResourceLocation,PlayerPredicate.AdvancementPredicate> advancements, Optional<EntityPredicate> lookingAt)
extends Record
implements EntitySubPredicate
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static final record
(package private) static final record
(package private) static interface
static class
(package private) static final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map
<ResourceLocation, PlayerPredicate.AdvancementPredicate> The field for theadvancements
record component.static final com.mojang.serialization.MapCodec
<PlayerPredicate> private final GameTypePredicate
The field for thegameType
record component.private final MinMaxBounds.Ints
The field for thelevel
record component.static final int
private final Optional
<EntityPredicate> The field for thelookingAt
record component.private final it.unimi.dsi.fastutil.objects.Object2BooleanMap
<ResourceLocation> The field for therecipes
record component.private final List
<PlayerPredicate.StatMatcher<?>> The field for thestats
record component. -
Constructor Summary
ConstructorDescriptionPlayerPredicate
(MinMaxBounds.Ints level, GameTypePredicate gameType, List<PlayerPredicate.StatMatcher<?>> stats, it.unimi.dsi.fastutil.objects.Object2BooleanMap<ResourceLocation> recipes, Map<ResourceLocation, PlayerPredicate.AdvancementPredicate> advancements, Optional<EntityPredicate> lookingAt) Creates an instance of aPlayerPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadvancements
record component.com.mojang.serialization.MapCodec
<PlayerPredicate> codec()
final boolean
Indicates whether some other object is "equal to" this one.gameType()
Returns the value of thegameType
record component.final int
hashCode()
Returns a hash code value for this object.level()
Returns the value of thelevel
record component.Returns the value of thelookingAt
record component.boolean
matches
(Entity p_222484_, ServerLevel p_222485_, Vec3 p_222486_) it.unimi.dsi.fastutil.objects.Object2BooleanMap
<ResourceLocation> recipes()
Returns the value of therecipes
record component.stats()
Returns the value of thestats
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
level
The field for thelevel
record component. -
gameType
The field for thegameType
record component. -
stats
The field for thestats
record component. -
recipes
The field for therecipes
record component. -
advancements
The field for theadvancements
record component. -
lookingAt
The field for thelookingAt
record component. -
LOOKING_AT_RANGE
public static final int LOOKING_AT_RANGE- See Also:
-
CODEC
-
-
Constructor Details
-
PlayerPredicate
public PlayerPredicate(MinMaxBounds.Ints level, GameTypePredicate gameType, List<PlayerPredicate.StatMatcher<?>> stats, it.unimi.dsi.fastutil.objects.Object2BooleanMap<ResourceLocation> recipes, Map<ResourceLocation, PlayerPredicate.AdvancementPredicate> advancements, Optional<EntityPredicate> lookingAt) Creates an instance of aPlayerPredicate
record class.- Parameters:
level
- the value for thelevel
record componentgameType
- the value for thegameType
record componentstats
- the value for thestats
record componentrecipes
- the value for therecipes
record componentadvancements
- the value for theadvancements
record componentlookingAt
- the value for thelookingAt
record component
-
-
Method Details
-
matches
- Specified by:
matches
in interfaceEntitySubPredicate
-
codec
- Specified by:
codec
in interfaceEntitySubPredicate
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
level
Returns the value of thelevel
record component.- Returns:
- the value of the
level
record component
-
gameType
Returns the value of thegameType
record component.- Returns:
- the value of the
gameType
record component
-
stats
Returns the value of thestats
record component.- Returns:
- the value of the
stats
record component
-
recipes
Returns the value of therecipes
record component.- Returns:
- the value of the
recipes
record component
-
advancements
Returns the value of theadvancements
record component.- Returns:
- the value of the
advancements
record component
-
lookingAt
Returns the value of thelookingAt
record component.- Returns:
- the value of the
lookingAt
record component
-