Skip to content

Conditional Data API #344

@RedstoneParadox

Description

@RedstoneParadox

A major flaw with data files is that if you want to add mod compatibility/integration in the form of data files (i.e. adding a recipe for another mod's workstation) is that you need to use mixins to prevent those data files from loading when the other mod is not present, otherwise, the console and logs are spammed with exceptions. Since this deals with inter-mod compatibility, I feel it would be a good fit for QSL to implement.

This API would consist of a simple event that would be fired every time MC finds a data file to load. Listeners would return a boolean to determine whether or not that file should be skipped. Since the most common use case would be checking whether a given mod is present, a helper function would also be available for creating a listener that checks if a given mod is loaded.

In the past, LibCD was used to accomplish this through a separate .mcmeta file for each data file you wanted to have conditionally loaded. In my experience, this approach was far from ergonomic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    library: dataRelated to the data library.new: moduleA pull request which adds a new module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions