Annotation Interface BlockTrait
fr.fidorial.world.block.data applies to, from the
properties they declare.
A block type implements a trait when it declares every property of properties(), the values of each
property satisfy values(), and it also satisfies the BlockTrait of every trait the interface
extends. For instance Stairs extends Directional, Bisected, Waterlogged only asks for shape: the
facing, half and waterlogged requirements come from its parents.
Detection never looks at the block key, so a new block sharing the properties of a trait gets it for free.
The traits of the API are indexed at compile time by an annotation processor, so a new trait is one annotated
public interface extending BlockData, with no list to update. Plugins compile without that processor:
their own traits are added to their blocks with BlockType.Builder.trait(Class).
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceRestricts the values a property may declare. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]Returns the names of the properties a block type must declare; empty when only the parent traits matter.Returns restrictions on the values of the declared properties.
-
Element Details
-
properties
String[] propertiesReturns the names of the properties a block type must declare; empty when only the parent traits matter.- Returns:
- the names of the properties a block type must declare; empty when only the parent traits matter
- Since:
- 0.1.0
- Default:
{}
-
values
BlockTrait.Values[] valuesReturns restrictions on the values of the declared properties.- Returns:
- restrictions on the values of the declared properties
- Since:
- 0.1.0
- Default:
{}
-