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 protected
IntProperty(String name, int min, int max)
-
Method Summary
Modifier and Type Method Description int
computeHashCode()
boolean
equals(Object object)
Collection<Integer>
getValues()
Returns all possible values the property can take.String
name(Integer integer)
static IntProperty
of(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:
computeHashCode
in classProperty<Integer>
-
of
Creates an integer property.min
must be non-negative andmax
must 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
-