Record Class StatePredicate

java.lang.Object
java.lang.Record
net.minecraft.predicate.StatePredicate
Record Components:
conditions -

public record StatePredicate(List<StatePredicate.Condition> conditions) extends Record
Mappings:
Namespace Name
official da
intermediary net/minecraft/class_4559
named net/minecraft/predicate/StatePredicate
official b
intermediary comp_1830
named conditions
  • Field Details

    • conditions

      private final List<StatePredicate.Condition> conditions
      The field for the conditions record component.
    • CONDITION_LIST_CODEC

      private static final com.mojang.serialization.Codec<List<StatePredicate.Condition>> CONDITION_LIST_CODEC
      Mappings:
      Namespace Name Mixin selector
      official c Lda;c:Lcom/mojang/serialization/Codec;
      intermediary field_45778 Lnet/minecraft/class_4559;field_45778:Lcom/mojang/serialization/Codec;
      named CONDITION_LIST_CODEC Lnet/minecraft/predicate/StatePredicate;CONDITION_LIST_CODEC:Lcom/mojang/serialization/Codec;
    • CODEC

      public static final com.mojang.serialization.Codec<StatePredicate> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Lda;a:Lcom/mojang/serialization/Codec;
      intermediary field_45777 Lnet/minecraft/class_4559;field_45777:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/predicate/StatePredicate;CODEC:Lcom/mojang/serialization/Codec;
  • Constructor Details

    • StatePredicate

      public StatePredicate(List<StatePredicate.Condition> conditions)
      Creates an instance of a StatePredicate record class.
      Parameters:
      conditions - the value for the conditions record component
  • Method Details

    • test

      public <S extends State<?, S>> boolean test(StateManager<?,S> stateManager, S container)
      Mappings:
      Namespace Name Mixin selector
      official a Lda;a(Ldfk;Ldfl;)Z
      intermediary method_22515 Lnet/minecraft/class_4559;method_22515(Lnet/minecraft/class_2689;Lnet/minecraft/class_2688;)Z
      named test Lnet/minecraft/predicate/StatePredicate;test(Lnet/minecraft/state/StateManager;Lnet/minecraft/state/State;)Z
    • test

      public boolean test(BlockState state)
      Mappings:
      Namespace Name Mixin selector
      official a Lda;a(Ldfj;)Z
      intermediary method_22514 Lnet/minecraft/class_4559;method_22514(Lnet/minecraft/class_2680;)Z
      named test Lnet/minecraft/predicate/StatePredicate;test(Lnet/minecraft/block/BlockState;)Z
    • test

      public boolean test(FluidState state)
      Mappings:
      Namespace Name Mixin selector
      official a Lda;a(Leam;)Z
      intermediary method_22518 Lnet/minecraft/class_4559;method_22518(Lnet/minecraft/class_3610;)Z
      named test Lnet/minecraft/predicate/StatePredicate;test(Lnet/minecraft/fluid/FluidState;)Z
    • findMissing

      public Optional<String> findMissing(StateManager<?,?> stateManager)
      Mappings:
      Namespace Name Mixin selector
      official a Lda;a(Ldfk;)Ljava/util/Optional;
      intermediary method_53235 Lnet/minecraft/class_4559;method_53235(Lnet/minecraft/class_2689;)Ljava/util/Optional;
      named findMissing Lnet/minecraft/predicate/StatePredicate;findMissing(Lnet/minecraft/state/StateManager;)Ljava/util/Optional;
    • check

      public void check(StateManager<?,?> factory, Consumer<String> reporter)
      Mappings:
      Namespace Name Mixin selector
      official a Lda;a(Ldfk;Ljava/util/function/Consumer;)V
      intermediary method_22516 Lnet/minecraft/class_4559;method_22516(Lnet/minecraft/class_2689;Ljava/util/function/Consumer;)V
      named check Lnet/minecraft/predicate/StatePredicate;check(Lnet/minecraft/state/StateManager;Ljava/util/function/Consumer;)V
    • fromJson

      public static Optional<StatePredicate> fromJson(@Nullable @Nullable com.google.gson.JsonElement json)
      Mappings:
      Namespace Name Mixin selector
      official a Lda;a(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
      intermediary method_22519 Lnet/minecraft/class_4559;method_22519(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
      named fromJson Lnet/minecraft/predicate/StatePredicate;fromJson(Lcom/google/gson/JsonElement;)Ljava/util/Optional;
    • toJson

      public com.google.gson.JsonElement toJson()
      Mappings:
      Namespace Name Mixin selector
      official a Lda;a()Lcom/google/gson/JsonElement;
      intermediary method_22513 Lnet/minecraft/class_4559;method_22513()Lcom/google/gson/JsonElement;
      named toJson Lnet/minecraft/predicate/StatePredicate;toJson()Lcom/google/gson/JsonElement;
    • 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.
    • conditions

      public List<StatePredicate.Condition> conditions()
      Returns the value of the conditions record component.
      Returns:
      the value of the conditions record component