Skip to content

Commit

Permalink
Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Jan 28, 2024
1 parent 1e52938 commit f22ce03
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/datamaps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A data map can be attached to both static, built-in, registries and dynamic data
Data maps support reloading through the use of the `/reload` command or any other means that reload server resources.

## Registration
A data map type should be statically created and then registered to the `RegisterDataMapTypesEvent` (which is fired on the mod event bus). The `DataMapType` can be created using a `DataMapType$Builder`, through `DataMapType#builder`.
A data map type should be statically created and then registered to the `RegisterDataMapTypesEvent` (which is fired on the [mod event bus](../concepts/events)). The `DataMapType` can be created using a `DataMapType$Builder`, through `DataMapType#builder`.

The builder provides a `synced` method which can be used to mark a data map as synced and have it sent to clients.

Expand Down Expand Up @@ -53,7 +53,7 @@ A separate network codec allows for packet sizes to be smaller, as you can choos
:::

## JSON Structure and location
Data maps are loaded from a JSON file located at `:mapNamespace/data_maps/:registryNamespace/:registryPath/:mapPath.json`, where:
Data maps are loaded from a JSON file located at `mapNamespace/data_maps/registryNamespace/registryPath/mapPath.json`, where:
- `mapNamespace` is the namespace of the ID of the data map
- `mapPath` is the path of the ID of the data map
- `registryNamespace` is the namespace of the ID of the registry
Expand Down Expand Up @@ -113,7 +113,7 @@ The above merger will merge the values if two datapacks attach to the same objec

We provide some default mergers for merging lists, sets and maps in `DataMapValueMerger`.

The default merger (`DataMapValueMerger#defaultMerger`) has the typical behaviour you'd expect from normal data packs, where the newest value (which comes from the highest datapack) always wins.
The default merger (`DataMapValueMerger#defaultMerger`) has the typical behaviour you'd expect from normal data packs, where the newest value (which comes from the highest datapack) overwrites the previous value.
### Removers
An advanced data map can provide a `DataMapValueRemover` through `AdvancedDataMapType#remover`. The remover will allow selective removals of data map values, effectively decomposition.
Expand Down Expand Up @@ -162,7 +162,7 @@ That file will attach the map `[somekey1=value1, somekey2=value2]` to the `minec
After the second datapack is read and applied, the new value attached to the `minecraft:carrot` item will be `[somekey2=value2]`.

## Datagen
Data maps can be generated through `DataMapProvider`.
Data maps can be [generated](../datagen) through `DataMapProvider`.
You should extend that class, and then override the `generate` method to create your entries, similar to tag generation.

Considering the drop healing example from the start, we could generate some values as follows:
Expand Down
2 changes: 1 addition & 1 deletion docs/datamaps/neo_maps.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Built-in Data Maps
NeoForge provides a few data maps that mostly replace hardcoded in-code vanilla maps.
These dats maps can be found in `NeoForgeDataMaps`.
These dats maps can be found in `NeoForgeDataMaps`, and are always *optional* to ensure compatibility with vanilla clients.

## `neoforge:compostables`
NeoForge provides a data map that allows configuring composter values, as a replacement for `ComposterBlock#COMPOSTABLES` (which is now ignored).
Expand Down
2 changes: 1 addition & 1 deletion docs/datamaps/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
For the purposes of this page, we will use a data map which is an object with two float keys: `amount` and `chance` as an example. The codec for that object can be found [here](./index.md#registration).

## Location
Data maps are loaded from a JSON file located at `:mapNamespace/data_maps/:registryNamespace/:registryPath/:mapPath.json`, where:
Data maps are loaded from a JSON file located at `mapNamespace/data_maps/registryNamespace/registryPath/mapPath.json`, where:
- `mapNamespace` is the namespace of the ID of the data map
- `mapPath` is the path of the ID of the data map
- `registryNamespace` is the namespace of the ID of the registry
Expand Down

1 comment on commit f22ce03

@neoforged-pages-deployments
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploying with Cloudflare Pages

Name Result
Last commit: f22ce0309f34964056abf6a3d869788b9ae79a05
Status: ✅ Deploy successful!
Preview URL: https://1b6a1898.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-46.neoforged-docs-previews.pages.dev

Please sign in to comment.