Package commoble.morered.util

# Class BlockStateUtil

java.lang.Object
commoble.morered.util.BlockStateUtil

public class BlockStateUtil extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final net.minecraft.core.Direction[][]`
`OUTPUT_TABLE`

## Constructor Summary

Constructors
Constructor
Description
`BlockStateUtil()`

## Method Summary

Modifier and Type
Method
Description
`static net.minecraft.core.Direction`
`getInputDirection(net.minecraft.core.Direction attachmentDirection, int outputRotationIndex, int rotationsFromOutput)`
`static int`
`getMirroredRotation(net.minecraft.core.Direction attachmentFace, int rotationIndex, net.minecraft.world.level.block.Mirror mirror)`
Get the rotation index for a gate plate state after mirroring the blockstate
`static net.minecraft.core.Direction`
`getOutputDirection(net.minecraft.core.Direction attachmentDirection, int rotationIndex)`
`static net.minecraft.core.Direction`
`getOutputDirectionFromRelativeHitVec(net.minecraft.world.phys.Vec3 hitVec, net.minecraft.core.Direction directionTowardBlockAttachedTo)`
`static int`
`getRotatedRotation(net.minecraft.core.Direction attachmentFace, int rotationIndex, net.minecraft.world.level.block.Rotation rotation)`
Get the rotation index for a gate plate state after rotating the blockstate around the y-axis
`static int`
`getRotationIndexForDirection(net.minecraft.core.Direction attachmentFace, net.minecraft.core.Direction outputDirection)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### OUTPUT_TABLE

public static final net.minecraft.core.Direction[][] OUTPUT_TABLE

## Constructor Details

### BlockStateUtil

public BlockStateUtil()

## Method Details

### getOutputDirection

public static net.minecraft.core.Direction getOutputDirection(net.minecraft.core.Direction attachmentDirection, int rotationIndex)

### getInputDirection

public static net.minecraft.core.Direction getInputDirection(net.minecraft.core.Direction attachmentDirection, int outputRotationIndex, int rotationsFromOutput)

### getRotatedRotation

public static int getRotatedRotation(net.minecraft.core.Direction attachmentFace, int rotationIndex, net.minecraft.world.level.block.Rotation rotation)
Get the rotation index for a gate plate state after rotating the blockstate around the y-axis

Parameters:
  `attachmentFace` - The attachment direction of a plate state
  `rotationIndex` - How many 90-degree rotations from the primary rotation we have
  `rotation` - The y-axis-rotation type
Returns:
  The new rotation index after rotating the blockstate

### getMirroredRotation

public static int getMirroredRotation(net.minecraft.core.Direction attachmentFace, int rotationIndex, net.minecraft.world.level.block.Mirror mirror)
Get the rotation index for a gate plate state after mirroring the blockstate

Parameters:
  `attachmentFace` - The attachment direction of a plate state
  `rotationIndex` - How many 90-degree rotations from the primary rotation we have
  `mirror` - The mirroring type
Returns:
  The new rotation index after mirroring the blockstate

### getRotationIndexForDirection

public static int getRotationIndexForDirection(net.minecraft.core.Direction attachmentFace, net.minecraft.core.Direction outputDirection)

### getOutputDirectionFromRelativeHitVec

public static net.minecraft.core.Direction getOutputDirectionFromRelativeHitVec(net.minecraft.world.phys.Vec3 hitVec, net.minecraft.core.Direction directionTowardBlockAttachedTo)