Allow subclasses of lang provider to change output path (#5069)

* Allow subclasses of lang providers to change output path

* Add javadoc

* Add [@]param note

* Checkstyle fix

---------

Co-authored-by: modmuss50 <modmuss50@gmail.com>
This commit is contained in:
skycatminepokie 2025-12-21 07:40:24 -08:00 committed by GitHub
parent 0469e9ce61
commit 69974c4edd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,7 +108,12 @@ public abstract class FabricLanguageProvider implements DataProvider {
});
}
private Path getLangFilePath(String code) {
/**
* Override this method to change where the generated language file is placed.
*
* @param code The language code (like "en_us") of the translations.
*/
protected Path getLangFilePath(String code) {
return dataOutput
.createPathProvider(PackOutput.Target.RESOURCE_PACK, "lang")
.json(Identifier.fromNamespaceAndPath(dataOutput.getModId(), code));