-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/net/manmaed/petrock/datagen/PRLanguageProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.manmaed.petrock.datagen; | ||
|
||
import net.manmaed.petrock.datagen.lang.PetRockENUS; | ||
import net.minecraft.data.DataGenerator; | ||
import net.minecraft.data.PackOutput; | ||
|
||
public class PRLanguageProvider { | ||
|
||
public static void addTranslations(DataGenerator generator) { | ||
PackOutput output = generator.getPackOutput(); | ||
/** | ||
* To Add a new LanguageProvider make a new fine in the net.manmaed.petrock.datagen.lang called PetRocklocale (eg PetRockENPT for Pirate Speak) | ||
* then make that extend LanguageProvider make it only need a PackOutput and define the modID as PetRock.MOD_ID and the locale in the super | ||
* Example: | ||
* public PetRockENPT(PackOutput output) { super(output, PetRock.MOD_ID, "en_pt") } | ||
* -- | ||
* please add the fist 2 lines to the new Language for Language Name, Translator Name | ||
* Example: | ||
* add("a.lang.file.name", "Pirate Speak"); | ||
* add("a.lang.author.name", "manmaed"); | ||
*/ | ||
generator.addProvider(true, new PetRockENUS(output)); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/net/manmaed/petrock/datagen/lang/PetRockENUS.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package net.manmaed.petrock.datagen.lang; | ||
|
||
import net.manmaed.petrock.PetRock; | ||
import net.minecraft.data.PackOutput; | ||
import net.neoforged.neoforge.common.data.LanguageProvider; | ||
|
||
public class PetRockENUS extends LanguageProvider { | ||
public PetRockENUS(PackOutput output) { | ||
super(output, PetRock.MOD_ID, "en_us"); | ||
} | ||
|
||
@Override | ||
protected void addTranslations() { | ||
add("a.lang.file.name", "English US"); | ||
add("a.lang.author.name", "manmaed"); | ||
add("itemGroup." + PetRock.MOD_ID, "PetRock"); | ||
//TODO: Make this | ||
} | ||
} |