Package net.minecraft.state.property
Class EnumProperty<T extends Enum<T> & StringIdentifiable>
java.lang.Object
net.minecraft.state.property.Property<T>
net.minecraft.state.property.EnumProperty<T>
- Direct Known Subclasses:
DirectionProperty
public class EnumProperty<T extends Enum<T> & StringIdentifiable> extends Property<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.state.property.Property
Property.Value<T extends Comparable<T>>
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
EnumProperty(String name, Class<T> type, Collection<T> values)
-
Method Summary
Modifier and Type Method Description int
computeHashCode()
boolean
equals(Object object)
Collection<T>
getValues()
Returns all possible values the property can take.String
name(T t)
static <T extends Enum<T> & StringIdentifiable>
EnumProperty<T>of(String name, Class<T> type)
Creates an enum property.static <T extends Enum<T> & StringIdentifiable>
EnumProperty<T>of(String name, Class<T> type, Collection<T> values)
Creates an enum property.static <T extends Enum<T> & StringIdentifiable>
EnumProperty<T>of(String name, Class<T> type, Predicate<T> filter)
Creates an enum property.static <T extends Enum<T> & StringIdentifiable>
EnumProperty<T>of(String name, Class<T> type, T[] values)
Optional<T>
parse(String name)
Methods inherited from class net.minecraft.state.property.Property
createValue, createValue, getName, getType, getValueCodec, hashCode, stream, toString
-
Field Details
-
values
-
byName
-
-
Constructor Details
-
EnumProperty
-
-
Method Details
-
getValues
Returns all possible values the property can take. -
parse
-
name
-
equals
-
computeHashCode
public int computeHashCode()- Overrides:
computeHashCode
in classProperty<T extends Enum<T> & StringIdentifiable>
-
of
public static <T extends Enum<T> & StringIdentifiable> EnumProperty<T> of(String name, Class<T> type)Creates an enum property.- Parameters:
name
- the name of this propertytype
- the type this property contains
-
of
public static <T extends Enum<T> & StringIdentifiable> EnumProperty<T> of(String name, Class<T> type, Predicate<T> filter)Creates an enum property.- Parameters:
name
- the name of this propertytype
- the type this property containsfilter
- a filter that specifies if a value is allowed
-
of
public static <T extends Enum<T> & StringIdentifiable> EnumProperty<T> of(String name, Class<T> type, T[] values) -
of
public static <T extends Enum<T> & StringIdentifiable> EnumProperty<T> of(String name, Class<T> type, Collection<T> values)Creates an enum property.- Parameters:
name
- the name of this propertytype
- the type this property containsvalues
- the values this property could contain
-