Class RotatedBlockStateProvider
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.state.provider.BlockStateProvider
com.github.darksoulq.abyssallib.world.gen.state.provider.impl.RotatedBlockStateProvider
A block state provider wrapper that intercepts the provided block state and rigidly
forces its orientation properties (Axis, Facing, or 16-point Rotation).
This is incredibly useful for ensuring branches always face outward, stairs always form roofs properly, or hanging vines are forced to a specific block face.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<RotatedBlockStateProvider> The codec used for serializing and deserializing the rotated block state provider.static final BlockStateProviderType<RotatedBlockStateProvider> The registered type definition for the rotated block state provider. -
Constructor Summary
ConstructorsConstructorDescriptionRotatedBlockStateProvider(BlockStateProvider baseProvider, org.bukkit.Axis axis, org.bukkit.block.BlockFace facing, Integer rotation) Constructs a new RotatedBlockStateProvider. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the base state and forcefully injects the defined orientation properties.getType()Retrieves the specific type definition for this provider.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the rotated block state provider. -
TYPE
The registered type definition for the rotated block state provider.
-
-
Constructor Details
-
RotatedBlockStateProvider
public RotatedBlockStateProvider(BlockStateProvider baseProvider, org.bukkit.Axis axis, org.bukkit.block.BlockFace facing, Integer rotation) Constructs a new RotatedBlockStateProvider.- Parameters:
baseProvider- The origin provider.axis- The axis to force upon the block state (nullable).facing- The direction to force upon the block state (nullable).rotation- The 0-15 rotation integer to force (nullable).
-
-
Method Details
-
getState
Retrieves the base state and forcefully injects the defined orientation properties.- Specified by:
getStatein classBlockStateProvider- Parameters:
random- The random source.location- The placement location.- Returns:
- The modified block info with the injected states.
-
getType
Retrieves the specific type definition for this provider.- Specified by:
getTypein classBlockStateProvider- Returns:
- The block state provider type.
-