[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / world/generators/datadriven/javaWorldgenSources

# world/generators/datadriven/javaWorldgenSources

## Interfaces

### JavaWorldgenSources

Defined in: [packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts:25](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts#L25)

The two directories the registries are read out of.

#### Properties

##### datapack

> `readonly` **datapack**: `string`

Defined in: [packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts:27](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts#L27)

The datapack root, the directory holding `data/`.

##### reports

> `readonly` **reports**: `string`

Defined in: [packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts:29](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts#L29)

The data generator output root, the directory holding `reports/`.

## Variables

### JAVA\_WORLDGEN\_ENV

> `const` **JAVA\_WORLDGEN\_ENV**: `object`

Defined in: [packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts:17](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts#L17)

Points the loader at a local copy of one fetched source.

#### Type Declaration

##### datapack

> `readonly` **datapack**: `"JSP_VANILLA_DATAPACK"` = `'JSP_VANILLA_DATAPACK'`

A Java vanilla datapack directory, as the Java data generator writes one.

##### reports

> `readonly` **reports**: `"JSP_JAVA_REPORTS"` = `'JSP_JAVA_REPORTS'`

A Java data generator output directory, the one holding `reports/`.

## Functions

### cacheRoot()

> **cacheRoot**(): `string`

Defined in: [packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts:33](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts#L33)

The nearest existing `node_modules/.cache/jsprismarine` at or above the working directory.

#### Returns

`string`

***

### findJavaWorldgenSources()

> **findJavaWorldgenSources**(`release?`): [`JavaWorldgenSources`](#javaworldgensources) \| `undefined`

Defined in: [packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts:74](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/generators/datadriven/javaWorldgenSources.ts#L74)

Finds the datapack and the data generator reports of one Java release.

#### Parameters

##### release?

`string` = `javaServerCacheFolder`

The pinned Java release whose data to read, such as the server's
  `content-java-version`. Defaults to the release `sources.json` names as the default. The
  environment overrides win over it.

#### Returns

[`JavaWorldgenSources`](#javaworldgensources) \| `undefined`

Both directories, or undefined when either is missing. The generator needs both,
  and half the data produces a world that is quietly not Java's.
