Record Class ResourceMatcher
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.resource.match.ResourceMatcher
- Record Components:
predicate- which variants matchamount- the minimum amount required; 0 means no requirement
A
ResourcePredicate plus an amount requirement, used by ports and recipes.-
Constructor Summary
ConstructorsConstructorDescriptionResourceMatcher(@NotNull ResourcePredicate predicate, long amount) Creates an instance of aResourceMatcherrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongamount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(@NotNull ResourceStack stack, @NotNull ResourceTags tags) booleanmatches(@NotNull ResourceVariant variant, @NotNull ResourceTags tags) static @NotNull ResourceMatcherof(@NotNull ResourcePredicate predicate) static @NotNull ResourceMatcherof(@NotNull ResourcePredicate predicate, long amount) @NotNull ResourcePredicateReturns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
-
of
@NotNull public static @NotNull ResourceMatcher of(@NotNull @NotNull ResourcePredicate predicate, long amount) -
matches
public boolean matches(@NotNull @NotNull ResourceVariant variant, @NotNull @NotNull ResourceTags tags) -
matches
- Returns:
- whether the stack matches and holds at least
amount()
-
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. -
predicate
-
amount
-