Record Class WeatheringCopperCollection.ByState<T>

java.lang.Object
java.lang.Record
net.minecraft.world.level.block.WeatheringCopperCollection.ByState<T>
Enclosing class:
WeatheringCopperCollection<T>

public static record WeatheringCopperCollection.ByState<T>(T unaffected, T exposed, T weathered, T oxidized) extends Record
  • Field Details

    • unaffected

      private final T unaffected
      The field for the unaffected record component.
    • exposed

      private final T exposed
      The field for the exposed record component.
    • weathered

      private final T weathered
      The field for the weathered record component.
    • oxidized

      private final T oxidized
      The field for the oxidized record component.
  • Constructor Details

    • ByState

      public ByState(T unaffected, T exposed, T weathered, T oxidized)
      Creates an instance of a ByState record class.
      Parameters:
      unaffected - the value for the unaffected record component
      exposed - the value for the exposed record component
      weathered - the value for the weathered record component
      oxidized - the value for the oxidized record component
  • Method Details

    • create

      public static <T> WeatheringCopperCollection.ByState<T> create(T value)
    • map

      public <U> WeatheringCopperCollection.ByState<U> map(Function<T,U> mapper)
    • pick

      public T pick(WeatheringCopper.WeatherState state)
    • forEach

      public void forEach(Consumer<T> consumer)
    • progressMapping

      public void progressMapping(BiConsumer<T,T> consumer)
    • 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 o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • unaffected

      public T unaffected()
      Returns the value of the unaffected record component.
      Returns:
      the value of the unaffected record component
    • exposed

      public T exposed()
      Returns the value of the exposed record component.
      Returns:
      the value of the exposed record component
    • weathered

      public T weathered()
      Returns the value of the weathered record component.
      Returns:
      the value of the weathered record component
    • oxidized

      public T oxidized()
      Returns the value of the oxidized record component.
      Returns:
      the value of the oxidized record component