Record Class ResolutionContext
java.lang.Object
java.lang.Record
net.minecraft.network.chat.ResolutionContext
public record ResolutionContext(@Nullable CommandSourceStack source, @Nullable Entity defaultScoreboardEntity, Predicate<ObjectInfo> objectInfoValidator, int depthLimit, ResolutionContext.LimitBehavior depthLimitBehavior)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable EntityThe field for thedefaultScoreboardEntityrecord component.private final intThe field for thedepthLimitrecord component.private final ResolutionContext.LimitBehaviorThe field for thedepthLimitBehaviorrecord component.private final Predicate<ObjectInfo> The field for theobjectInfoValidatorrecord component.private final @Nullable CommandSourceStackThe field for thesourcerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionResolutionContext(@Nullable CommandSourceStack source, @Nullable Entity defaultScoreboardEntity, Predicate<ObjectInfo> objectInfoValidator, int depthLimit, ResolutionContext.LimitBehavior depthLimitBehavior) Creates an instance of aResolutionContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ResolutionContext.Builderbuilder()static ResolutionContextcreate(CommandSourceStack source) @Nullable EntityReturns the value of thedefaultScoreboardEntityrecord component.intReturns the value of thedepthLimitrecord component.Returns the value of thedepthLimitBehaviorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theobjectInfoValidatorrecord component.@Nullable CommandSourceStacksource()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.@Nullable ObjectInfovalidate(ObjectInfo description)
-
Field Details
-
source
The field for thesourcerecord component. -
defaultScoreboardEntity
The field for thedefaultScoreboardEntityrecord component. -
objectInfoValidator
The field for theobjectInfoValidatorrecord component. -
depthLimit
private final int depthLimitThe field for thedepthLimitrecord component. -
depthLimitBehavior
The field for thedepthLimitBehaviorrecord component.
-
-
Constructor Details
-
ResolutionContext
public ResolutionContext(@Nullable CommandSourceStack source, @Nullable Entity defaultScoreboardEntity, Predicate<ObjectInfo> objectInfoValidator, int depthLimit, ResolutionContext.LimitBehavior depthLimitBehavior) Creates an instance of aResolutionContextrecord class.- Parameters:
source- the value for thesourcerecord componentdefaultScoreboardEntity- the value for thedefaultScoreboardEntityrecord componentobjectInfoValidator- the value for theobjectInfoValidatorrecord componentdepthLimit- the value for thedepthLimitrecord componentdepthLimitBehavior- the value for thedepthLimitBehaviorrecord component
-
-
Method Details
-
validate
-
create
-
builder
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
defaultScoreboardEntity
Returns the value of thedefaultScoreboardEntityrecord component.- Returns:
- the value of the
defaultScoreboardEntityrecord component
-
objectInfoValidator
Returns the value of theobjectInfoValidatorrecord component.- Returns:
- the value of the
objectInfoValidatorrecord component
-
depthLimit
public int depthLimit()Returns the value of thedepthLimitrecord component.- Returns:
- the value of the
depthLimitrecord component
-
depthLimitBehavior
Returns the value of thedepthLimitBehaviorrecord component.- Returns:
- the value of the
depthLimitBehaviorrecord component
-