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
Nested ClassesModifier and TypeClassDescription(package private) static final record(package private) static final record(package private) static interfacestatic class(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<ResourceLocation, PlayerPredicate.AdvancementPredicate> The field for theadvancementsrecord component.static final com.mojang.serialization.MapCodec<PlayerPredicate> private final GameTypePredicateThe field for thegameTyperecord component.private final MinMaxBounds.IntsThe field for thelevelrecord component.static final intprivate final Optional<EntityPredicate> The field for thelookingAtrecord component.private final it.unimi.dsi.fastutil.objects.Object2BooleanMap<ResourceLocation> The field for therecipesrecord component.private final List<PlayerPredicate.StatMatcher<?>> The field for thestatsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPlayerPredicate(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 aPlayerPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadvancementsrecord component.com.mojang.serialization.MapCodec<PlayerPredicate> codec()final booleanIndicates whether some other object is "equal to" this one.gameType()Returns the value of thegameTyperecord component.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.Returns the value of thelookingAtrecord component.booleanmatches(Entity p_222484_, ServerLevel p_222485_, Vec3 p_222486_) it.unimi.dsi.fastutil.objects.Object2BooleanMap<ResourceLocation> recipes()Returns the value of therecipesrecord component.stats()Returns the value of thestatsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
level
The field for thelevelrecord component. -
gameType
The field for thegameTyperecord component. -
stats
The field for thestatsrecord component. -
recipes
The field for therecipesrecord component. -
advancements
The field for theadvancementsrecord component. -
lookingAt
The field for thelookingAtrecord 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 aPlayerPredicaterecord class.- Parameters:
level- the value for thelevelrecord componentgameType- the value for thegameTyperecord componentstats- the value for thestatsrecord componentrecipes- the value for therecipesrecord componentadvancements- the value for theadvancementsrecord componentlookingAt- the value for thelookingAtrecord component
-
-
Method Details
-
matches
- Specified by:
matchesin interfaceEntitySubPredicate
-
codec
- Specified by:
codecin 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 thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
gameType
Returns the value of thegameTyperecord component.- Returns:
- the value of the
gameTyperecord component
-
stats
Returns the value of thestatsrecord component.- Returns:
- the value of the
statsrecord component
-
recipes
Returns the value of therecipesrecord component.- Returns:
- the value of the
recipesrecord component
-
advancements
Returns the value of theadvancementsrecord component.- Returns:
- the value of the
advancementsrecord component
-
lookingAt
Returns the value of thelookingAtrecord component.- Returns:
- the value of the
lookingAtrecord component
-