GeneralUtil - Lemonszz/LKLib GitHub Wiki

GeneralUtil contains helpful utility methods that don't really fit anywhere else.

HORIZONTALS

This is an array of each horizontal direction (North, Easy, Sound, West). Mainly here for convenience.

randomHorizontal

This method will return a random horizontal direction.

randomOrderedHorizontals

Will return a list of the horizontal directions in a random order. You shouldn't modify this list.

getHandPossiblyHolding

This method assumes the entity is holding the item in at least 1 of it's hands.
Will return the main hand if the predicate is met with the item in the mainhand, otherwise the offhand.

addStrippedLog

This method will likely be moved to BlockUtil.
Registers the Stripped log version of a log. WoodTypeInfo handles this automatically.

isAdjacentDirection

Basically just checks if the two given directions are not opposites.