Package commoble.morered.util

# Class DirectionHelper

java.lang.Object
commoble.morered.util.DirectionHelper

public class DirectionHelper extends Object

## Constructor Summary

Constructors
Constructor
Description
`DirectionHelper()`

## Method Summary

Modifier and Type
Method
Description
`static int`
`getCompressedSecondSide(int primary, int secondary)`
Returns the relative secondary side index given two side indices.
`static net.minecraft.core.Direction`
`getDirectionToNeighborPos(net.minecraft.core.BlockPos from, net.minecraft.core.BlockPos to)`
`static int`
`uncompressSecondSide(int primarySide, int secondarySide)`
Inverts the getCompressedSecondSide operation, converting a compressed secondary ordinal back to the [0,5] range.

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

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

## Constructor Details

### DirectionHelper

public DirectionHelper()

## Method Details

### getCompressedSecondSide

public static int getCompressedSecondSide(int primary, int secondary)
Returns the relative secondary side index given two side indices. Some definitions: -- let a side index be the ordinal of a Direction -- let a relative secondary side index be an integer in the range [0,3], representing what the ordinal of a direction would be if the primary side and its opposite didn't exist e.g. if the primary side is NORTH, the secondary indices would represent down, up, west, east, respectively

Parameters:
  `primary` - side index, the side index representing the interior face a wire is attached to
  `secondary` - side index representing which direction a wire line is pointing from the center of the face, must *not* be the same axis as the primary side or an incorrect result will be returned
Returns:
  the relative secondary side index given two side indices

### uncompressSecondSide

public static int uncompressSecondSide(int primarySide, int secondarySide)
Inverts the getCompressedSecondSide operation, converting a compressed secondary ordinal back to the [0,5] range.

Parameters:
  `primarySide` - A direction ordinal in the range [0,5]
  `secondarySide` - A compressed direction ordinal relative to the first, in the range [0,3]
Returns:
  A direction ordinal in the range [0,5]

### getDirectionToNeighborPos

@Nullable public static net.minecraft.core.Direction getDirectionToNeighborPos(net.minecraft.core.BlockPos from, net.minecraft.core.BlockPos to)