Adding Your Own Content¶
TL;DR
Write your assets into config/lostcities/userassets.json, which the mod already loads and loads last. Anything you define there with the same type and name as something the mod ships replaces it. A file holding a palette, parts, buildings, a city style, a world style and a pinned city generated all of it on a real 1.12.2 server. game test
The load list¶
The set of asset files is a config option, not a fixed list. general.cfg describes it in the mod's own words: code review
List of asset libraries loaded in the specified order. If the path starts with '/' it is going to be loaded directly from the classpath. If the path starts with '$' it is loaded from the config directory code review
The first character of each entry decides where it is read from: code review
| Prefix | Resolved as | Example |
|---|---|---|
/ |
A resource inside a jar, through getResourceAsStream |
/assets/lostcities/citydata/library.json |
$ |
The config directory, plus the rest of the path | $lostcities/userassets.json becomes config/lostcities/userassets.json |
| anything else | Nothing. The mod throws Invalid path for lostcity resource in 'assets' config! |
|
| code review |
A path with no prefix is a hard failure at startup rather than a skipped entry, so a plain userassets.json without the $ stops the game. code review
Where your file goes¶
The default list is the mod's ten files in a fixed order, with one config entry after them: game test
/assets/lostcities/citydata/conditions.json
/assets/lostcities/citydata/palette.json
/assets/lostcities/citydata/palette_desert.json
/assets/lostcities/citydata/palette_chisel.json
/assets/lostcities/citydata/palette_chisel_desert.json
/assets/lostcities/citydata/highwayparts.json
/assets/lostcities/citydata/railparts.json
/assets/lostcities/citydata/monorailparts.json
/assets/lostcities/citydata/buildingparts.json
/assets/lostcities/citydata/library.json
$lostcities/userassets.json
So config/lostcities/userassets.json is already wired and already last. Creating it is the whole setup step, and the file is an array in the same shape as any other: code review
[
{
"type": "palette",
"name": "mypalette",
"palette": [
{ "char": "#", "block": "minecraft:concrete@8" },
{ "char": "_", "block": "minecraft:air" }
]
},
{
"type": "part",
"name": "mytower",
"xsize": 16, "zsize": 16,
"palette": "mypalette",
"slices": [ ]
}
]
Adding a further file means adding an entry to assets, and its position in the list is what decides who wins a collision. code review
Overriding something the mod ships¶
Each asset is stored under its name, and a later load of the same name replaces the earlier one. Since userassets.json sits last, defining citystyle_common there gives you the mod's city style with your version in its place. code review
The replacement is the whole asset, not a merge of keys, so an override has to restate everything the original held that you still want. code review
That is the entire override mechanism. There is no namespace to avoid a collision with and no pack ordering, only position in one config list. code review
Turning a world into a Lost Cities world¶
Two settings, and both are needed. The mod registers a world type called
lostcities, and a profile only takes effect on a world of that type. game test
| Where | Setting | Does |
|---|---|---|
server.properties, or the world creation screen |
level-type=lostcities |
Makes the world a Lost Cities world at all |
general.cfg |
defaultProfile=<name> |
Says which profile that world uses |
general.cfg |
additionalDimensions |
Wires a separate dimension instead, <numeric id>:<profile> |
| game test |
Setting defaultProfile on its own does nothing visible. The world stays ordinary
terrain, because nothing told it to use the Lost Cities generator. game test
The mod also ships its own dimension, id 111 by default in dimensionId, with
dimensionProfile choosing its profile. game test
Config, and one file per profile¶
The config is Forge's old .cfg, not TOML, and a profile is a whole file rather than a JSON object: code review
| Path | Holds |
|---|---|
config/lostcities/general.cfg |
14 options, including the three below |
config/lostcities/profile_<name>.cfg |
One profile. 128 keys in 2.0.22, against 131 in 7.4.12. 18 files ship, 16 public and 2 private |
config/lostcities/userassets.json |
Your assets |
| game test |
Every key of a profile is on its own page: File-Era Profile Reference. game test
Three options in general.cfg decide what exists at all: code review
| Option | What it does |
|---|---|
assets |
The load list above |
profiles |
Which profiles the world creation screen offers. The mod warns that one of them must be default |
privateProfiles |
Profiles a player cannot pick, used only as another profile's child |
| code review |
A new profile therefore takes two steps rather than one: write profile_<name>.cfg, then add that name to profiles. Writing the file alone leaves it unoffered. code review
The dimension wiring uses a colon, not an equals
The option is additionalDimensions in the general category, and its format is '<id>:<profile>'. The id is a number: general.cfg ships dimensionId=111, because 1.12 identifies a dimension by integer rather than by resource location. game test
The datapack era's dimensionsWithProfiles uses <dimension id>=<profile name> instead. Carrying the = backwards gives an entry that does not parse, and carrying the : forwards does the same. code review code review
Moving content to a modern version¶
The concepts carry over. The files do not, and renaming will not do it. code review
| What has to change | From | To |
|---|---|---|
| File layout | One array holding many assets | One file per asset |
| Naming | A name key |
The file path |
| Type | A type key |
The folder |
| Block names | minecraft:rail@1 |
minecraft:rail[shape=north_south] |
| References | Bare names | namespace:path, or bare meaning lostcities: |
| City style selectors | Flat, entry key is the type | Nested under selectors, entry key is value |
| Biome selection | A flat list of bare names | A Matcher taking tags |
| code review code review |
The block names are the part that fails loudest. A single @ left behind takes the whole palette down rather than that one entry. game test
See also¶
- The File-Asset Era
- File-Era Assets
- Namespaces for the system that replaced bare names