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 intGet the index of the given value in the list of valuesdefault intgetIndexFor(CharSequence value) Get the index of the given value in the list of valuesdefault PropertyKeygetKey()Get thePropertyKeyassociated with this property.getName()Returns the name of this state.default PropertyRemap<T> Get aPropertyRemapinstance 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 thePropertyKeyassociated with this property. -
getRemap
Get aPropertyRemapinstance for this property with the given remap.- Parameters:
from- value to remap fromto- value to remap to- Returns:
- new
PropertyRemapinstance
-