Class StateHolder<O,S>
java.lang.Object
net.minecraft.world.level.block.state.StateHolder<O,S>
- Direct Known Subclasses:
BlockBehaviour.BlockStateBase, FluidState
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStateHolder(O owner, Property<?>[] propertyKeys, Comparable<?>[] propertyValues) -
Method Summary
Modifier and TypeMethodDescriptionprotected static <O, S extends StateHolder<O,S>>
Codec<S> codec(Codec<O> ownerCodec, Function<O, S> defaultState, Function<O, StateDefinition<O, S>> stateDefinition) private static <T extends Comparable<T>>
Property.Value<T> createValue(Property<T> propertyKey, Comparable<?> propertyValue) <T extends Comparable<T>>
Sfinal booleanprotected static <T> TfindNextInCollection(List<T> values, T current) private <T extends Comparable<T>>
@Nullable TgetNullableValue(Property<T> property) <T extends Comparable<T>>
Optional<T> getOptionalValue(Property<T> property) Collection<Property<?>> <T extends Comparable<T>>
T<T extends Comparable<T>>
TgetValueOrElse(Property<T> property, T defaultValue) Stream<Property.Value<?>> inthashCode()booleanhasProperty(Property<?> property) (package private) voidinitializeNeighbors(S[][] neighbors) boolean<T extends Comparable<T>, V extends T>
Sprivate <T extends Comparable<T>, V extends T>
SsetValueInternal(Property<T> property, int propertyIndex, V value) toString()<T extends Comparable<T>, V extends T>
StrySetValue(Property<T> property, V value) private intvalueIndex(Property<?> property)
-
Field Details
-
VALUE_NOT_FOUND
private static final int VALUE_NOT_FOUND- See Also:
-
NAME_TAG
- See Also:
-
PROPERTIES_TAG
- See Also:
-
owner
-
propertyKeys
-
propertyValues
-
neighbors
-
-
Constructor Details
-
StateHolder
-
-
Method Details
-
cycle
-
findNextInCollection
-
toString
-
equals
-
hashCode
-
getProperties
-
valueIndex
-
hasProperty
-
getNullableValue
-
getValue
-
getOptionalValue
-
getValueOrElse
-
setValue
-
trySetValue
-
setValueInternal
private <T extends Comparable<T>, V extends T> S setValueInternal(Property<T> property, int propertyIndex, V value) -
initializeNeighbors
-
isSingletonState
public boolean isSingletonState() -
getValues
-
createValue
private static <T extends Comparable<T>> Property.Value<T> createValue(Property<T> propertyKey, Comparable<?> propertyValue) -
codec
protected static <O, S extends StateHolder<O,S>> Codec<S> codec(Codec<O> ownerCodec, Function<O, S> defaultState, Function<O, StateDefinition<O, S>> stateDefinition)
-