public abstract class State<O,S> extends Object
Modifier and Type | Field and Description |
---|---|
protected com.mojang.serialization.MapCodec<S> |
codec |
private ImmutableMap<Property<?>,Comparable<?>> |
entries |
protected O |
owner |
private static Function<Map.Entry<Property<?>,Comparable<?>>,String> |
PROPERTY_MAP_PRINTER |
private Table<Property<?>,Comparable<?>,S> |
withTable |
Modifier | Constructor and Description |
---|---|
protected |
State(O owner,
ImmutableMap<Property<?>,Comparable<?>> entries,
com.mojang.serialization.MapCodec<S> codec) |
Modifier and Type | Method and Description |
---|---|
<T extends Comparable<T>> |
contains(Property<T> property) |
protected static <O,S extends State<O,S>> |
createCodec(com.mojang.serialization.Codec<O> codec,
Function<O,S> ownerToStateFunction) |
void |
createWithTable(Map<Map<Property<?>,Comparable<?>>,S> states) |
<T extends Comparable<T>> |
cycle(Property<T> property) |
<T extends Comparable<T>> |
get(Property<T> property) |
ImmutableMap<Property<?>,Comparable<?>> |
getEntries() |
protected static <T> T |
getNext(Collection<T> values,
T value) |
Collection<Property<?>> |
getProperties() |
<T extends Comparable<T>> |
method_28500(Property<T> property) |
private Map<Property<?>,Comparable<?>> |
toMapWith(Property<?> property,
Comparable<?> value) |
String |
toString() |
<T extends Comparable<T>,V extends T> |
with(Property<T> property,
V value) |
private static final Function<Map.Entry<Property<?>,Comparable<?>>,String> PROPERTY_MAP_PRINTER
protected final O owner
private final ImmutableMap<Property<?>,Comparable<?>> entries
private Table<Property<?>,Comparable<?>,S> withTable
protected final com.mojang.serialization.MapCodec<S> codec
protected State(O owner, ImmutableMap<Property<?>,Comparable<?>> entries, com.mojang.serialization.MapCodec<S> codec)
public <T extends Comparable<T>> S cycle(Property<T> property)
protected static <T> T getNext(Collection<T> values, T value)
public Collection<Property<?>> getProperties()
public <T extends Comparable<T>> boolean contains(Property<T> property)
public <T extends Comparable<T>> T get(Property<T> property)
public <T extends Comparable<T>> Optional<T> method_28500(Property<T> property)
public <T extends Comparable<T>,V extends T> S with(Property<T> property, V value)
public void createWithTable(Map<Map<Property<?>,Comparable<?>>,S> states)
private Map<Property<?>,Comparable<?>> toMapWith(Property<?> property, Comparable<?> value)
public ImmutableMap<Property<?>,Comparable<?>> getEntries()