promotional bannermobile promotional banner

Cave Generator

A powerful and customizable replacement for Mojang's cave generator.

File Details

CaveGenerator-1.0.jar

  • R
  • May 19, 2021
  • 550.93 KB
  • 1.9K
  • 1.12.2+2

File Name

CaveGenerator-1.0.jar

Supported Versions

  • 1.12.2
  • 1.12.1
  • 1.12

Cave Generator 1.0

Cave Generator 1.0 is finally here. It's the largest update I've ever done, featuring:

  • A nearly full rewrite
  • An overhauled preset parsing system
  • Tons of improvements to the Cave expression language
  • New generators and decorators
  • Several new config options
  • A fluent command API for manipulating preset files and testing cave expressions, and
  • A major default preset other than vanilla.cave

If that sounds like a lot, it is.
Tons of fields have been renamed to be more consistent. To upgrade from an older version, try starting with a fresh config/cavegenerator directory to make sure all of your files are up to date. Don't worry about your old presets. They will be 99% converted over when you add them back.

A view of the new cat preset.

 

Developers:

If you like this mod and wanna help, reach out to me on Discord or GitHub. Let's get this mod ported over to 1.16!

 

New Default Presets

 

cat

The new default preset. Features tons of unique features in various different biomes. Consists of a massive inter-connected network of tunnels with caverns at lava level and near the surface in mountain biomes. Several unique biome themes.

Check out the demo album for a preview of how this looks.

 

cat_lite

A variant of the regular cat preset with fewer biome-themed features. This features only the generic generators and their wet counterparts in ocean biomes.

 

ore_veins

Adds a series of massive ore veins that emulate the new generator in 1.17 using clusters and cellular noise. Look for unique pairs of ores and other blocks and start digging.

 

geodes

Adds a new type of geode that emulates the geode structures in Biome Bundle. These have an obsidian shell and house various minerals, ores, and lava.

 

New Generators

 

Burrows

Introducing Burrows: a never-ending network of tunnels. This generator features various settings for controlling radii, offset noise, exponent curves, adding branches, and more.

Demo of burrow generator

 

New Decorators

 

Shell

Can be applied to any world carver: tunnels, ravines, burrows, rooms, and caverns. This is a single feature with an array of decorators. Shells are like wall decorators, but they can dig any number of blocks deep into the wall and lack directionality. They produce smoother cutoff lines for tunnels, ravines, burrows, and rooms, as they are based around a center height for each of those features.

Demo of shell decorators

 

Ponds

Ponds are like wall decorators, but they (usually) do not touch the walls and instead only spawn on the floor. These can also be multiple blocks thick.

Demo of pond decorators

 

Cave Expression Language

 

Better Imports

Imports can be stored in subdirectories. You can refer to these files in your import expressions by writing their relative path inside of the imports folder as dir/file.ext.

 

Functions

Cave functions are a kind of data template. These are written just like variables, but can contain arguments.

Demo of functions

 

Access Control

Imported variables and variables defined inside of the variables object are considered implicitly private and cannot be re-exported. Only top-level data can be exported.

 

Recursive Overrides

Add a key to any object starting with a *. Write it as a path in dotfix notation. Its value will be copied recursively to any field matching the pattern. Remember that object arrays can be treated as single objects in Cave Generator.

 

Arithmetic Expressions

Any arithmetic expression written in your data files will be automatically evaluated after variables are substituted. Meaning you can write e.g. $SEA_LEVEL - 10 to produce a dynamic height value.

 

In-place Variable Substitution

Variables are substituted in-place, meaning $SEA_LEVEL + $OFFSET is now a valid expression.

 

Overhauled Presets

 

Inner Presets

Any preset can contain an array of inner presets. These are regular presets which inherit default values from their parent.

Inner preset demo

 

Override Settings

The only top level data fields you can define are enabled and all of the regular generators now. Whatever fields you define at the top, e.g. biomes, height, etc. are now considered overrides and will applied to any object that uses them at a lower level. The same is true for nested generators, i.e. branches and rooms.

 

Conditions and Decorators Everywhere

Condition settings and decorators can now be applied to any object that uses them. Meaning a single preset can have tunnels and caverns that each use different biome restrictions.

 

Tons of Field Renames

Most fields have been renamed to be more consistent. There are too many to list here. Check the new reference file if needed and otherwise know your fields will automatically be transformed if they have been renamed.

 

Min and Max Values are Single Ranges

There is no minX or maxX field anymore. Instead, we have x ranges. This means you can write either height: [ 10, 50 ] or just height: 50 to produce a constant height value.

 

All Generators are Arrays

Individual presets can contain multiple cavern generators.

 

Everything is Possible in One Preset

The new preset parser is extremely flexible. There are tons of ways to express your generators using the new preset structure and cave expression language.

 

Preset Compat

Preset Compat was greatly enhanced to almost fully transform old presets.

 

New Imports

 

types

This preset comes with a series of functions that essentially create new and unique types. These include geodes, ore veins, roots, vines, and more.

 

blocks

A list of various blocks with metadata that creates an abstraction around them so they're easier to read. Use these variables for better compatibility with 1.16+ versions of the mod.

 

conditions

A series of variables and functions for neatly defining biome and height restrictions in your preset.

 

All cat Imports

11 different files to create all of the shapes and features that make up the new cat and cat_lite presets. This folder also includes common.cave, which contains a series of global settings for controlling the height ranges and biomes in which cat features can spawn. If your sea level is higher than 63 or bedrock is lower than 5, edit these settings to dynamically adapt your cat presets to those conditions.

 

Other Import Changes

 

defaults

This file is a regular preset now. You should consider moving regular presets into the imports folder so they can be reused and have conditions applied externally. This is much easier to test.

 

Tunnel Sockets

Three new features have gained implicit Tunnel Connector generators: caverns, burrows, and other tunnels. Adding `branches` to one of these generators will produce a Tunnel Connector in your world. These connectors are just like regular tunnel generators, except that they evaluate the output of their parent generator before spawning. This means that every branch origin must spawn inside of the parent feature.

Tunnel Socket demo

 

Overhauled Restrictions

  • Added biome-restricted caverns
  • All features have noise, ceiling, floor, region, and other restrictions
  • Restricted features can no longer overlap

 

Noise Improvements

 

Updated Noise Keys for Clarity

Replaced noise2D and noise3D with noise, map, and region.

 

Most Noise Settings Can Be Used Anywhere

Every generator object now inherits fields from the common condition settings. These include biomes, dimensions, noise, region, and more.

 

Noise Output Caching

Set cache: true to produce a cached generator. Cached noise types are valid for generators where threshold, range, and invert are different. You must apply a common seed for cached generators to synchronize.

 

Ranged Thresholds

scale was replaced with threshold and is now the raw value that was produced by scale. Convert with

      threshold = scale * 2 - 1
    

You can now apply a min and max threshold, e.g. [ -1, 0.5 ] to filter the noise output based on more specific ranges.

 

Dummy Generators

Set dummy: true to produce a dummy generator. Optionally set dummyOutput: <output></output> to specify the output (default = 0). Use this for any noise generator where the effect is invisible or insignificant and gain a performance boost.

 

Stalactite Improvements

 

stalactites.space

How much space should be present below the stalactite.

 

stalactites.symmetrical

Whether the sides and corners of the stalactite should be constant or random.

 

stalactites.type

Replacement for largeStalagmites and largeStlactites. Now put all of your stalactite types in one array and specify the type. This may be stalactite, stalagmite, speleothem.

 

stalactites.size

Replacement for wide. This may be small, medium, large, or giant. medium is the original wide: true.

 

Added speleothems

A variant of stalactites which connects both on bottom and top. Be careful with space when using this. Low values mean you technically get a longer stalactite instead.

 

Better length control

maxLength is now just length, a specific range of values.

Demo of new large stalactites Demo of new large stalactites

 

Cavern Improvements

 

caverns.offset

A map generator which offsets the input y-coordinate. This effectively shifts your entire cavern up or down over time, distorting their appearance.

 

caverns.walls

A map generator which offsets the required biome distance at any given y-level.

 

caverns.wallOffset

A map generator which shifts the wall noise in the current chunk. Use this is you have very large caverns with obvious walls.

 

caverns.wallCurveRatio

A ratio of the wall curve used by this feature. Stretches or shrinks it.

 

caverns.wallInterpolation

Whether to interpolate the biome map evaluated by this generator. Using this may produce smoother walls for most wide, but short caverns.

 

caverns.deferred

A temporary value used for deferring the generation stage of this feature. This is specifically intended for generating aquifers which are guaranteed to generate after tunnels, ravines, and other features.

 

caverns.branches

The tunnel connector socket for this feature. This is a regular tunnels object which must originate inside of this generator's output.

 

Caverns is Now an Array

You can optionally place multiple entire cavern generators inside of a single preset. generators, replacement for noise3D, is still an array in this feature, but is now nested one level deeper to improve flexibility with ceiling, floor, and other restrictions.

 

Union Types

Using caverns.noise (a new common restriction) will require both noise and any of the generators to return true at a given coordinate. This means you can doubly restrict your cavern's output.

 

Caverns Support Biome Restrictions

Cave Generator is now able to simulate closing off generating noise blobs by producing a wall that surrounds valid biomes.

Cavern biome restrictions demo

 

Ravine Improvements

 

ravines.cutoffStrength

Lower values reduce the flatness at the bottom and top of this feature.

 

ravines.originHeight

Unlike height, this controls the starting height for ravine origins.

 

ravines.checkWater

Whether to enable the water checks for this feature. Disable these for any feature that never needs a cutoff around water pockets for Better performance.

 

Tunnel Improvements

 

tunnels.branches

A regular tunnels object which controls the shape and angles of this feature's branches. Can be defined recursively.

 

tunnels.originHeight

Unlike height, this controls the starting height for ravine origins.

 

tunnels.checkWater

Whether to enable the water checks for this feature. Disable these for any feature that never needs a cutoff around water pockets for Better performance.

 

tunnels.seed

A predictable seed for this feature. Does not persist across worlds. This produces regular looking patterns that repeat throughout the world.

 

tunnels.reseedBranches

Whether to produce a new seed for each branch. When false, branches will have the same shape as their parents.

 

Structure Improvements

 

structures.blockChecks

A list of specific blocks and their relative coordinates to check for.

 

structures.command

A command to run whenever this structure generates. Can interpolate coordinates with {x}, {y}, and {z}

 

structures.replacedBlock

One of the vanilla placement settings. Determines which block can be replaced by this structure.

 

structures.mirror

One of the vanilla placement settings. Determines how to mirror this structure.

 

structures.ignoreEntities

One of the vanilla placement settings. Determines whether to spawn any entities captured by the NBT data.

 

structures.checkSurface

Controls whether this feature is allowed to spawn above the surface.

 

Cluster Improvements

 

clusters.matchers

A set of blocks this cluster can spawn in. This will defer the feature so that it can only spawn inside of another cluster or stone layer. Use this to spawn xenoliths underground.

 

clusters.integrity

A 0~1 ratio of blocks to place.

 

clusters.seed

A predictable seed used by this feature. Use this to have multiple clusters overlap with different settings.

 

Direction Improvements

Added north, south, east, and west directions to structures and wall decorators.

 

New Config Options

 

enableMineshafts

Whether to allow vanilla or other mineshaft generators to spawn.

 

ignoreInvalidPresets

Whether to ignore preset errors. Instead of crashing the game on startup, invalid presets will simply be skipped over and logged. `/cave list` will not reflect this.

 

mapRange

How far to search out for tunnel, ravine, and other map features. You'll need to increase this when using really large tunnel and map features. Alternatively, decrease this when only using shorter map features.

 

biomeRange

How far to search out each chunk to form a biome border. Biomes are evaluated in four corners each chunk and then once per chunk in each surrounding chunk. Increase this value to support wider and smoother biome curves.

 

autoFormat

Whether to rewrite each of your preset each time they're loaded. This has the effect of formatting them for you.

 

autoGenerate

Whether to write the expanded versions of your presets automatically on load. Use this to easily track what you're variables and functions are doing.

 

updateImports

Whether to automatically attempt to update your import files as though they're regular presets. Disable this if you don't need them updated and want to save some time on load.

 

New Commands

 

ch

Modifies the chat height multiple beyond what the main options menu allows. Run /cave ch max to automatically determine and set a reasonable height.

 

cw

Modifies the chat width beyond what the main options menu allows. Also supports /cave cw max.

 

untest

Sets your gamemode to creative and removes night vision.

 

copy

Copies a preset into your preset directory. Supports recursive

preset searching.

 

move

Moves a preset out of your presets directory.

 

delete

Moves a preset to your backups directory. Backed up files with the same name will be renamed and numbered.

 

define and set

Defines or sets a variable in working memory. Use this for the interactive Cave expression evaluator. E.g.

      /cave define TEST: { dummy: true }`
    

 

import

Evaluates an import expression to copy values from an import file into working memory.

 

eval

Evaluates any cave expression, e.g.

      /cave eval 1 + 2(3) ^ 4
    

or

      /cave eval $simple_generator(1.0, simplex)
    

 

print

Prints the definition of a variable in memory. If the variable includes documentation comments, they will be linted and displayed correctly in the chat window. (100 lines max)

 

display

Renders an entire preset in the chat using the builtin Cave linter. (100 lines max)

 

dir

Prints an array of all variables defined in working memory.

 

save

Records all variables in working memory to a file when given a name.

 

clear

Clears all variables from working memory.

 

Other Command Changes

 

Improved combine

Supports more complex paths.

 

Improved reload

Running /cave reload now also reloads structures files.

 

Improved open

Running /cave open by itself now opens the presets directory.

 

Overhauled list

The list command is now interactive. It allows you to navigate through your filesystem to locate presets. Presets can be enabled from any directory. A copy will be made inside of your presets directory with the file enabled and reloaded automatically.

 

Built in Cave syntax linter

Commands that display Cave data and expressions will highlight various elements to display them clearly in the chat. Supports keys, references, functions, comments, to-dos, documentation comments, and more.

 

Better command colors

Many commands have had their outputs colorized.

 

Better error messages

Exceptions thrown by cave commands will display a cause, if present.

 

Recursive preset arguments

Most commands with preset arguments contain a following argument for the directory. If the directory argument is missing, it will recursively search for the file in the Cave Generator directory and all subdirectories.

 

Internal Improvements

  • Nearly a full rewrite of the mod. At least 20k changes
  • Overhauled internal structure to be much more sophisticated
  • Added a new builtin type heirarchy. Only needs 2 hooks.
  • Tons of optimizations
  • Countless bug fixes
  • Switched over to a XoRoShiRo type RNG
  • Biome checks are cached reused across most generators
  • Very liberal use of code generation. No double typing field names.

 

Miscellaneous Improvements

  • Renamed tutorial_stripped to reference
  • reference now outlines where all conditions and decorators can go
  • The in-game config is now supported