Class RotatedBlockStateProvider

java.lang.Object
com.github.darksoulq.abyssallib.world.gen.state.provider.BlockStateProvider
com.github.darksoulq.abyssallib.world.gen.state.provider.impl.RotatedBlockStateProvider

public class RotatedBlockStateProvider extends BlockStateProvider
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 Details

  • 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

      public BlockInfo getState(Random random, org.bukkit.Location location)
      Retrieves the base state and forcefully injects the defined orientation properties.
      Specified by:
      getState in class BlockStateProvider
      Parameters:
      random - The random source.
      location - The placement location.
      Returns:
      The modified block info with the injected states.
    • getType

      public BlockStateProviderType<?> getType()
      Retrieves the specific type definition for this provider.
      Specified by:
      getType in class BlockStateProvider
      Returns:
      The block state provider type.