Class EnumProperty<T extends Enum<T> & StringRepresentable>
java.lang.Object
net.minecraft.world.level.block.state.properties.Property<T>
net.minecraft.world.level.block.state.properties.EnumProperty<T>
- Direct Known Subclasses:
DirectionProperty
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.block.state.properties.Property
Property.Value<T extends Comparable<T>>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EnumProperty
(String pName, Class<T> pClazz, Collection<T> pValues) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Enum<T> & StringRepresentable>
EnumProperty<T> Create a new EnumProperty with all Enum constants of the given class.static <T extends Enum<T> & StringRepresentable>
EnumProperty<T> create
(String pName, Class<T> pClazz, Collection<T> pValues) Create a new EnumProperty with the specified valuesstatic <T extends Enum<T> & StringRepresentable>
EnumProperty<T> Create a new EnumProperty with all Enum constants of the given class that match the given Predicate.static <T extends Enum<T> & StringRepresentable>
EnumProperty<T> Create a new EnumProperty with the specified valuesboolean
int
Methods inherited from class net.minecraft.world.level.block.state.properties.Property
codec, getAllValues, getName, getValueClass, hashCode, parseValue, toString, value, value, valueCodec
-
Field Details
-
values
private final com.google.common.collect.ImmutableSet<T extends Enum<T> & StringRepresentable> values -
names
Map of names to Enum values
-
-
Constructor Details
-
EnumProperty
-
-
Method Details
-
getPossibleValues
- Specified by:
getPossibleValues
in classProperty<T extends Enum<T> & StringRepresentable>
-
getValue
-
getName
-
equals
-
generateHashCode
public int generateHashCode()- Overrides:
generateHashCode
in classProperty<T extends Enum<T> & StringRepresentable>
-
create
public static <T extends Enum<T> & StringRepresentable> EnumProperty<T> create(String pName, Class<T> pClazz) Create a new EnumProperty with all Enum constants of the given class. -
create
public static <T extends Enum<T> & StringRepresentable> EnumProperty<T> create(String pName, Class<T> pClazz, Predicate<T> pFilter) Create a new EnumProperty with all Enum constants of the given class that match the given Predicate. -
create
public static <T extends Enum<T> & StringRepresentable> EnumProperty<T> create(String pName, Class<T> pClazz, T... pValues) Create a new EnumProperty with the specified values -
create
public static <T extends Enum<T> & StringRepresentable> EnumProperty<T> create(String pName, Class<T> pClazz, Collection<T> pValues) Create a new EnumProperty with the specified values
-