Skip to content

Commit

Permalink
tried datagen
Browse files Browse the repository at this point in the history
no success, again
  • Loading branch information
201st-Luka committed Aug 8, 2024
1 parent 70282c7 commit 9c4b0c4
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/main/java/luka/modularmap/datagen/ModularMapDataGenerator.java
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

package luka.modularmap.datagen;

import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

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<RegistryWrapper.WrapperLookup> 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
}
}

0 comments on commit 9c4b0c4

Please sign in to comment.