Class StateHolder<O,S>

java.lang.Object
net.minecraft.world.level.block.state.StateHolder<O,S>
Direct Known Subclasses:
BlockBehaviour.BlockStateBase, FluidState

public abstract class StateHolder<O,S> extends Object
  • Field Details

  • Constructor Details

    • StateHolder

      protected StateHolder(O p_61117_, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>,Comparable<?>> p_326342_, com.mojang.serialization.MapCodec<S> p_61119_)
  • Method Details

    • cycle

      public <T extends Comparable<T>> S cycle(Property<T> p_61123_)
    • findNextInCollection

      protected static <T> T findNextInCollection(List<T> p_373062_, T p_61132_)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object p_394267_)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getProperties

      public Collection<Property<?>> getProperties()
    • hasProperty

      public boolean hasProperty(Property<?> p_61139_)
    • getValue

      public <T extends Comparable<T>> T getValue(Property<T> p_61144_)
    • getOptionalValue

      public <T extends Comparable<T>> Optional<T> getOptionalValue(Property<T> p_61146_)
    • getValueOrElse

      public <T extends Comparable<T>> T getValueOrElse(Property<T> p_363461_, T p_362474_)
    • getNullableValue

      @Nullable private <T extends Comparable<T>> T getNullableValue(Property<T> p_360378_)
    • setValue

      public <T extends Comparable<T>, V extends T> S setValue(Property<T> p_61125_, V p_61126_)
    • trySetValue

      public <T extends Comparable<T>, V extends T> S trySetValue(Property<T> p_263324_, V p_263334_)
    • setValueInternal

      private <T extends Comparable<T>, V extends T> S setValueInternal(Property<T> p_372896_, V p_372842_, Comparable<?> p_372921_)
    • populateNeighbours

      public void populateNeighbours(Map<Map<Property<?>,Comparable<?>>,S> p_61134_)
    • makeNeighbourValues

      private Map<Property<?>,Comparable<?>> makeNeighbourValues(Property<?> p_61141_, Comparable<?> p_61142_)
    • getValues

      public Map<Property<?>,Comparable<?>> getValues()
    • codec

      protected static <O, S extends StateHolder<O, S>> com.mojang.serialization.Codec<S> codec(com.mojang.serialization.Codec<O> p_61128_, Function<O,S> p_61129_)