Package net.minecraft.state.property
Class IntProperty
public class IntProperty extends Property<Integer>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.state.property.Property
Property.Value<T extends Comparable<T>> -
Field Summary
Fields Modifier and Type Field Description private ImmutableSet<Integer>values -
Constructor Summary
Constructors Modifier Constructor Description protectedIntProperty(String name, int min, int max) -
Method Summary
Modifier and Type Method Description intcomputeHashCode()booleanequals(Object object)Collection<Integer>getValues()Returns all possible values the property can take.Stringname(Integer integer)static IntPropertyof(String name, int min, int max)Creates an integer property.Optional<Integer>parse(String name)Methods inherited from class net.minecraft.state.property.Property
createValue, createValue, getName, getType, getValueCodec, hashCode, stream, toString
-
Field Details
-
values
-
-
Constructor Details
-
IntProperty
-
-
Method Details
-
getValues
Returns all possible values the property can take. -
equals
-
computeHashCode
public int computeHashCode()- Overrides:
computeHashCodein classProperty<Integer>
-
of
Creates an integer property.minmust be non-negative andmaxmust be greater thanmin.Note that this method takes O(
max-min) time as it computes all possible values during instantiation.- Parameters:
name- the name of the propertymin- the minimum value the property can takemax- the maximum value the property can take
-
parse
-
name
-