Record Class ComponentExistencePredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.component.ComponentExistencePredicate
Record Components:
type -
All Implemented Interfaces:
ComponentPredicate

public record ComponentExistencePredicate(ComponentType<?> type) extends Record implements ComponentPredicate
Mappings:
Namespace Name
named net/minecraft/predicate/component/ComponentExistencePredicate
intermediary net/minecraft/class_12167
official ks
named type
intermediary comp_5089
official a
  • Field Details

    • type

      private final ComponentType<?> type
      The field for the type record component.
  • Constructor Details

    • ComponentExistencePredicate

      public ComponentExistencePredicate(ComponentType<?> type)
      Creates an instance of a ComponentExistencePredicate record class.
      Parameters:
      type - the value for the type record component
  • Method Details

    • test

      public boolean test(ComponentsAccess components)
      Specified by:
      test in interface ComponentPredicate
      Mappings:
      Namespace Name Mixin selector
      named test Lnet/minecraft/predicate/component/ComponentPredicate;test(Lnet/minecraft/component/ComponentsAccess;)Z
      intermediary method_58161 Lnet/minecraft/class_9360;method_58161(Lnet/minecraft/class_9473;)Z
      official a Lky;a(Lkj;)Z
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • type

      public ComponentType<?> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component