diff --git a/src/main/java/luka/modularmap/datagen/ModularMapDataGenerator.java b/src/main/java/luka/modularmap/datagen/ModularMapDataGenerator.java index fcc6b9f..6cc9f2f 100644 --- a/src/main/java/luka/modularmap/datagen/ModularMapDataGenerator.java +++ b/src/main/java/luka/modularmap/datagen/ModularMapDataGenerator.java @@ -1,3 +1,21 @@ +/* + * ModularMap + * Copyright (c) 2024 201st-Luka + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + package luka.modularmap.datagen; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; @@ -8,8 +26,6 @@ public class ModularMapDataGenerator implements DataGeneratorEntrypoint { public void onInitializeDataGenerator(FabricDataGenerator generator) { FabricDataGenerator.Pack pack = generator.createPack(); - // Adding a provider example: - // - // pack.addProvider(AdvancementsProvider::new); + pack.addProvider(ModularMapEnUsLanguageProvider::new); } } diff --git a/src/main/java/luka/modularmap/datagen/ModularMapEnUsLanguageProvider.java b/src/main/java/luka/modularmap/datagen/ModularMapEnUsLanguageProvider.java new file mode 100644 index 0000000..dc84d95 --- /dev/null +++ b/src/main/java/luka/modularmap/datagen/ModularMapEnUsLanguageProvider.java @@ -0,0 +1,37 @@ +/* + * ModularMap + * Copyright (c) 2024 201st-Luka + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package luka.modularmap.datagen; + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider; +import net.minecraft.registry.RegistryWrapper; + +import java.util.concurrent.CompletableFuture; + +public class ModularMapEnUsLanguageProvider extends FabricLanguageProvider { + public ModularMapEnUsLanguageProvider(FabricDataOutput dataOutput, + CompletableFuture registryLookup) { + super(dataOutput, "en_us", registryLookup); + } + + @Override + public void generateTranslations(RegistryWrapper.WrapperLookup registryLookup, TranslationBuilder translationBuilder) { +// translationBuilder.add(KeyInputHandler); // does not work because KeyInputHandler is not available on server + } +}