Easier mod integration
cam72cam opened this issue · 2 comments
I'm the main developer of Immersive Railroading and some of my users have been pointing me your way. My block system is a bit finikey and I'd rather not extend IFluidLoggable.
Would it be possible to look for jar resources at a common location to read a whitelist/blacklist from?
I would then be able to include a file in my jar like:
assets/immersiverailroading/fluidlogged/whitelist.json
[
{"blockId":"immersiverailroading:block_rail_gag"},
{"blockId":"immersiverailroading:block_rail"}
]
Optifine does something similar for dynamic lighting configs: https://github.com/TeamOpenIndustry/UniversalModCore/blob/1.12.2-forge/src/main/resources/assets/universalmodcore/optifine/dynamic_lights.properties
Some pseudocode:
for mod in forge.mods {
String path = String.format("assets/%s/fluidlogged/whitelist.json", mod.ID);
URL url = this.getClass().getResource(path);
if (url != null) {
addWhitelist(this.getClass().getResourceAsStream(path))
}
}