Vector3 newValue = getNewStateValue(dirProp.getValues(), transform, value.toVector()); if (newValue != null) { result = result.with(dirProp, Direction.findClosest(newValue, Direction.Flag.ALL)); result = result.with(enumProp, axis); OptionalInt newRotation = Direction.findClosest(vec, horizontalFlags).toRotationIndex(); if (newRotation.isPresent()) { result = result.with(intProp, newRotation.getAsInt()); result = result.with(block.getBlockType().getProperty(directionName), directionalProperties.contains(directionName));