Package net.minecraft.state
Class StateContainer<O,S extends StateHolder<O,S>>
- java.lang.Object
-
- net.minecraft.state.StateContainer<O,S>
-
public class StateContainer<O,S extends StateHolder<O,S>> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StateContainer.Builder<O,S extends StateHolder<O,S>>
static interface
StateContainer.IFactory<O,S>
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern
NAME_PATTERN
private O
owner
private com.google.common.collect.ImmutableSortedMap<java.lang.String,Property<?>>
propertiesByName
private com.google.common.collect.ImmutableList<S>
states
-
Constructor Summary
Constructors Modifier Constructor Description protected
StateContainer(java.util.function.Function<O,S> p_i231877_1_, O p_i231877_2_, StateContainer.IFactory<O,S> p_i231877_3_, java.util.Map<java.lang.String,Property<?>> p_i231877_4_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description S
any()
private static <S extends StateHolder<?,S>,T extends java.lang.Comparable<T>>
com.mojang.serialization.MapCodec<S>appendPropertyCodec(com.mojang.serialization.MapCodec<S> p_241487_0_, java.util.function.Supplier<S> p_241487_1_, java.lang.String p_241487_2_, Property<T> p_241487_3_)
O
getOwner()
com.google.common.collect.ImmutableList<S>
getPossibleStates()
java.util.Collection<Property<?>>
getProperties()
Property<?>
getProperty(java.lang.String p_185920_1_)
java.lang.String
toString()
-
-
-
Field Detail
-
NAME_PATTERN
private static final java.util.regex.Pattern NAME_PATTERN
-
owner
private final O owner
-
propertiesByName
private final com.google.common.collect.ImmutableSortedMap<java.lang.String,Property<?>> propertiesByName
-
states
private final com.google.common.collect.ImmutableList<S extends StateHolder<O,S>> states
-
-
Method Detail
-
appendPropertyCodec
private static <S extends StateHolder<?,S>,T extends java.lang.Comparable<T>> com.mojang.serialization.MapCodec<S> appendPropertyCodec(com.mojang.serialization.MapCodec<S> p_241487_0_, java.util.function.Supplier<S> p_241487_1_, java.lang.String p_241487_2_, Property<T> p_241487_3_)
-
getPossibleStates
public com.google.common.collect.ImmutableList<S> getPossibleStates()
-
any
public S any()
-
getOwner
public O getOwner()
-
getProperties
public java.util.Collection<Property<?>> getProperties()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getProperty
@Nullable public Property<?> getProperty(java.lang.String p_185920_1_)
-
-