Interface Property<T>
- All Known Implementing Classes:
AbstractProperty
,BooleanProperty
,DirectionalProperty
,EnumProperty
,IntegerProperty
public interface Property<T>
Describes a state property of a block.
Example states include "variant" (indicating material or type) and "facing" (indicating orientation).
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
Get the index of the given value in the list of valuesdefault int
getIndexFor
(CharSequence value) Get the index of the given value in the list of valuesdefault PropertyKey
getKey()
Get thePropertyKey
associated with this property.getName()
Returns the name of this state.default PropertyRemap
<T> Get aPropertyRemap
instance for this property with the given remap.getValueFor
(String string) Gets the value for the given string, or null.Return a list of available values for this state.
-
Method Details
-
getName
String getName()Returns the name of this state.- Returns:
- The state name
-
getValues
Return a list of available values for this state.- Returns:
- the list of state values
-
getValueFor
Gets the value for the given string, or null.- Parameters:
string
- The string- Returns:
- The value, or null
- Throws:
IllegalArgumentException
- When the value is invalid.
-
getIndex
Get the index of the given value in the list of values- Parameters:
value
- value to get index for- Throws:
IllegalArgumentException
- if value not applicable to this property
-
getIndexFor
Get the index of the given value in the list of values- Parameters:
value
- value to get index for- Throws:
IllegalArgumentException
- if value not applicable to this property
-
getKey
Get thePropertyKey
associated with this property. -
getRemap
Get aPropertyRemap
instance for this property with the given remap.- Parameters:
from
- value to remap fromto
- value to remap to- Returns:
- new
PropertyRemap
instance
-