Skip to content

Metadata-dependent rules for the block datafixer - #280

Open
Atilist wants to merge 11 commits into
ModificationStation:developfrom
Atilist:datafixer-expansion
Open

Metadata-dependent rules for the block datafixer#280
Atilist wants to merge 11 commits into
ModificationStation:developfrom
Atilist:datafixer-expansion

Conversation

@Atilist

@Atilist Atilist commented Aug 17, 2026

Copy link
Copy Markdown

Overview

Expands the block datafixer with an intermediary data structure MetaDependentIdConversion to allow for each metadata to output a different block ID and also change the output metadata. New rules can be added any time after a default rule is specified using a putState method. Metadata stays the same whenever the default rule applies.

An example of birch wood being converted to purple wool can be found in the test mod:
putStateMetaRule(17, 2, "minecraft:wool", 10);

Documentation

New and existing block conversion methods for StationFlatteningBlockSchema have been documented so the code becomes easier to understand for other developers. Some other datafixer classes have been partially documented too.

Compatibility

Most changes are inside the StationFlatteningBlockSchema class. The existing methods have the same inputs as before so none of the old datafixer configurations are broken by this.

@calmilamsy calmilamsy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me otherwise, thanks for adding javadocs where mine missed them.

* @param outputMeta New metadata
* @param id New identifier (including the namespace)
*/
public static void putStateMetaRule(int oldId, int meta, int outputMeta, String id) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

outputMeta should be the last arg. (Applies to all methods like this one.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants