Record Class StateDefinition.StateCollection<S extends StateHolder<?,?>>

java.lang.Object
java.lang.Record
net.minecraft.world.level.block.state.StateDefinition.StateCollection<S>
Enclosing class:
StateDefinition<O, S extends StateHolder<O,S>>

static record StateDefinition.StateCollection<S extends StateHolder<?,?>>(Map<List<Comparable<?>>, S extends StateHolder<?,?>> statesByValues, Map<List<Comparable<?>>, S extends StateHolder<?,?>[]> statesByPivotCache) extends Record
  • Field Details

    • statesByValues

      private final Map<List<Comparable<?>>, S extends StateHolder<?,?>> statesByValues
      The field for the statesByValues record component.
    • statesByPivotCache

      private final Map<List<Comparable<?>>, S extends StateHolder<?,?>[]> statesByPivotCache
      The field for the statesByPivotCache record component.
  • Constructor Details

    • StateCollection

      StateCollection(Map<List<Comparable<?>>, S> statesByValues, Map<List<Comparable<?>>, S[]> statesByPivotCache)
      Creates an instance of a StateCollection record class.
      Parameters:
      statesByValues - the value for the statesByValues record component
      statesByPivotCache - the value for the statesByPivotCache record component
  • Method Details

    • fillNeighborsForState

      public S[][] fillNeighborsForState(Property<?>[] propertyKeys, List<Comparable<?>> propertyValues)
    • fillStatesForPivot

      private <T extends Comparable<T>> S[] fillStatesForPivot(List<Comparable<?>> valuesKey, Property<T> pivot, int pivotIndex)
    • computeStatesForPivot

      private <T extends Comparable<T>> S[] computeStatesForPivot(List<Comparable<?>> valuesKey, Property<T> pivot, int pivotIndex)
    • 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.
    • statesByValues

      public Map<List<Comparable<?>>, S> statesByValues()
      Returns the value of the statesByValues record component.
      Returns:
      the value of the statesByValues record component
    • statesByPivotCache

      public Map<List<Comparable<?>>, S[]> statesByPivotCache()
      Returns the value of the statesByPivotCache record component.
      Returns:
      the value of the statesByPivotCache record component