-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added datagen * resolved the review comments.
- Loading branch information
1 parent
1b3d43a
commit 7476102
Showing
20 changed files
with
205 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
1 change: 1 addition & 0 deletions
1
src/generated/resources/.cache/2d025c766d0478ee26f8f463c3f04c6bea3d1051
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 @@ | ||
// 1.21 2024-07-16T21:16:17.593569 Block States: techarium |
2 changes: 2 additions & 0 deletions
2
src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d
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,2 @@ | ||
// 1.21 2024-07-16T21:16:17.5915544 Loot Tables | ||
21e41bc3df14e22048e4353330bdcd863d767df4 data/techarium/loot_table/blocks/basic_deploy_child_block.json |
1 change: 1 addition & 0 deletions
1
src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e
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 @@ | ||
// 1.21 2024-07-16T21:16:17.593569 Sound Definitions |
1 change: 1 addition & 0 deletions
1
src/generated/resources/.cache/7387973cad8b4d911c103741d2c774b2a450e559
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 @@ | ||
// 1.21 2024-07-16T21:16:17.5875595 Tags for minecraft:block mod id techarium |
1 change: 1 addition & 0 deletions
1
src/generated/resources/.cache/78f46b13c0433506213237f81ac2ec31158b750b
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 @@ | ||
// 1.21 2024-07-16T21:16:17.5925544 Tags for minecraft:item mod id techarium |
1 change: 1 addition & 0 deletions
1
src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e
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 @@ | ||
// 1.21 2024-07-16T21:16:17.5925544 Recipes |
2 changes: 2 additions & 0 deletions
2
src/generated/resources/.cache/dbf529bf5edf53a9096d7108e07b1e2ebc6eb742
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,2 @@ | ||
// 1.21 2024-07-16T21:32:01.4712927 Languages: en_us for mod: techarium | ||
ce15b8beba57cfc95f056d9594cb4b833603dcb4 assets/techarium/lang/en_us.json |
1 change: 1 addition & 0 deletions
1
src/generated/resources/.cache/df4b9506ef6ee3321a44a7e1dbb8123478e7c172
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 @@ | ||
// 1.21 2024-07-16T21:16:17.5865909 Item Models: techarium |
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,3 @@ | ||
{ | ||
"block.techarium.basic_deploy_child_block": "Basic Deploy Child Block" | ||
} |
4 changes: 4 additions & 0 deletions
4
src/generated/resources/data/techarium/loot_table/blocks/basic_deploy_child_block.json
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,4 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"random_sequence": "techarium:blocks/basic_deploy_child_block" | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/kotlin/earth/terrarium/techarium/datagen/TechariumDatagen.kt
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,37 @@ | ||
package earth.terrarium.techarium.datagen | ||
|
||
import earth.terrarium.techarium.common.TechariumConstants | ||
import earth.terrarium.techarium.datagen.providers.* | ||
import net.minecraft.data.loot.LootTableProvider | ||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets | ||
import net.neoforged.bus.api.IEventBus | ||
import net.neoforged.fml.ModContainer | ||
import net.neoforged.fml.common.Mod | ||
import net.neoforged.neoforge.data.event.GatherDataEvent | ||
|
||
@Mod(TechariumConstants.MOD_ID) | ||
class TechariumDatagen(modBus: IEventBus, mod: ModContainer) { | ||
init { | ||
modBus.addListener(::gatherDataEvent) | ||
} | ||
|
||
private fun gatherDataEvent(event: GatherDataEvent) { | ||
val generator = event.generator | ||
val output = generator.packOutput | ||
val existingFileHelper = event.existingFileHelper | ||
val lookupProvider = event.lookupProvider | ||
|
||
generator.addProvider(event.includeClient(), TechariumLanguageProvider(output, "en_us")) | ||
generator.addProvider(event.includeClient(), TechariumItemModelProvider(output, existingFileHelper)) | ||
val blockTagProvider = TechariumBlockTagProvider(output, lookupProvider, existingFileHelper) | ||
generator.addProvider(event.includeServer(), blockTagProvider) | ||
generator.addProvider(event.includeServer(), TechariumItemTagProvider(output, lookupProvider, blockTagProvider.contentsGetter(), existingFileHelper)) | ||
generator.addProvider(event.includeServer(), TechariumRecipeProvider(output, lookupProvider)) | ||
generator.addProvider(event.includeClient(), TechariumSoundProvider(output, existingFileHelper)) | ||
generator.addProvider(event.includeClient(), TechariumBlockStateProvider(output, existingFileHelper)) | ||
generator.addProvider(event.includeServer(), LootTableProvider(output, setOf(), | ||
listOf(LootTableProvider.SubProviderEntry(::TechariumBlockLootTableProvider, LootContextParamSets.BLOCK)), lookupProvider) | ||
) | ||
|
||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ain/kotlin/earth/terrarium/techarium/datagen/providers/TechariumBlockLootTableProvider.kt
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 earth.terrarium.techarium.datagen.providers | ||
|
||
import earth.terrarium.techarium.common.registries.ModBlocks | ||
import net.minecraft.core.HolderLookup | ||
import net.minecraft.data.loot.BlockLootSubProvider | ||
import net.minecraft.world.flag.FeatureFlags | ||
import net.minecraft.world.level.block.Block | ||
|
||
class TechariumBlockLootTableProvider( | ||
provider: HolderLookup.Provider | ||
) : BlockLootSubProvider(setOf(), FeatureFlags.REGISTRY.allFlags(), provider) { | ||
override fun getKnownBlocks(): MutableIterable<Block> { | ||
return ModBlocks.registry.entries.map { it.get() }.toMutableList() | ||
} | ||
|
||
override fun generate() { | ||
add(ModBlocks.basicDeployChildBlock, noDrop()) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/earth/terrarium/techarium/datagen/providers/TechariumBlockStateProvider.kt
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,15 @@ | ||
package earth.terrarium.techarium.datagen.providers | ||
|
||
import earth.terrarium.techarium.common.TechariumConstants | ||
import net.minecraft.data.PackOutput | ||
import net.neoforged.neoforge.client.model.generators.BlockStateProvider | ||
import net.neoforged.neoforge.common.data.ExistingFileHelper | ||
|
||
class TechariumBlockStateProvider( | ||
output: PackOutput, | ||
fileHelper: ExistingFileHelper | ||
) : BlockStateProvider(output, TechariumConstants.MOD_ID, fileHelper) { | ||
override fun registerStatesAndModels() { | ||
|
||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/kotlin/earth/terrarium/techarium/datagen/providers/TechariumBlockTagProvider.kt
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,18 @@ | ||
package earth.terrarium.techarium.datagen.providers | ||
|
||
import earth.terrarium.techarium.common.TechariumConstants | ||
import net.minecraft.core.HolderLookup | ||
import net.minecraft.data.PackOutput | ||
import net.neoforged.neoforge.common.data.BlockTagsProvider | ||
import net.neoforged.neoforge.common.data.ExistingFileHelper | ||
import java.util.concurrent.CompletableFuture | ||
|
||
class TechariumBlockTagProvider( | ||
output: PackOutput, | ||
lookupProvider: CompletableFuture<HolderLookup.Provider>, | ||
fileHelper: ExistingFileHelper | ||
) : BlockTagsProvider(output, lookupProvider, TechariumConstants.MOD_ID, fileHelper) { | ||
override fun addTags(holderLookup: HolderLookup.Provider) { | ||
|
||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/earth/terrarium/techarium/datagen/providers/TechariumItemModelProvider.kt
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,15 @@ | ||
package earth.terrarium.techarium.datagen.providers | ||
|
||
import earth.terrarium.techarium.common.TechariumConstants | ||
import net.minecraft.data.PackOutput | ||
import net.neoforged.neoforge.client.model.generators.ItemModelProvider | ||
import net.neoforged.neoforge.common.data.ExistingFileHelper | ||
|
||
class TechariumItemModelProvider( | ||
output: PackOutput, | ||
fileHelper: ExistingFileHelper | ||
) : ItemModelProvider(output, TechariumConstants.MOD_ID, fileHelper) { | ||
override fun registerModels() { | ||
|
||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/kotlin/earth/terrarium/techarium/datagen/providers/TechariumItemTagProvider.kt
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,20 @@ | ||
package earth.terrarium.techarium.datagen.providers | ||
|
||
import earth.terrarium.techarium.common.TechariumConstants | ||
import net.minecraft.core.HolderLookup | ||
import net.minecraft.data.PackOutput | ||
import net.minecraft.data.tags.ItemTagsProvider | ||
import net.minecraft.world.level.block.Block | ||
import net.neoforged.neoforge.common.data.ExistingFileHelper | ||
import java.util.concurrent.CompletableFuture | ||
|
||
class TechariumItemTagProvider( | ||
output: PackOutput, | ||
lookupProvider: CompletableFuture<HolderLookup.Provider>, | ||
blockTags: CompletableFuture<TagLookup<Block>>, | ||
fileHelper: ExistingFileHelper | ||
) : ItemTagsProvider(output, lookupProvider, blockTags, TechariumConstants.MOD_ID, fileHelper) { | ||
override fun addTags(holderLookup: HolderLookup.Provider) { | ||
|
||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/earth/terrarium/techarium/datagen/providers/TechariumLanguageProvider.kt
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,21 @@ | ||
package earth.terrarium.techarium.datagen.providers | ||
|
||
import earth.terrarium.techarium.common.TechariumConstants | ||
import earth.terrarium.techarium.common.registries.ModBlockEntityTypes | ||
import earth.terrarium.techarium.common.registries.ModBlocks | ||
import net.minecraft.data.PackOutput | ||
import net.neoforged.neoforge.common.data.LanguageProvider | ||
|
||
class TechariumLanguageProvider( | ||
output: PackOutput, | ||
locale: String | ||
) : LanguageProvider(output, TechariumConstants.MOD_ID, locale) { | ||
override fun addTranslations() { | ||
for (entry in ModBlocks.registry.entries) { | ||
addBlock(entry, entry.id.path.split("_") | ||
.joinToString(" ") { it.replaceFirstChar(Character::toTitleCase) }) | ||
} | ||
|
||
//TODO: Add the translation generation using the item registry. | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/kotlin/earth/terrarium/techarium/datagen/providers/TechariumRecipeProvider.kt
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,16 @@ | ||
package earth.terrarium.techarium.datagen.providers | ||
|
||
import net.minecraft.core.HolderLookup | ||
import net.minecraft.data.PackOutput | ||
import net.minecraft.data.recipes.RecipeOutput | ||
import net.minecraft.data.recipes.RecipeProvider | ||
import java.util.concurrent.CompletableFuture | ||
|
||
class TechariumRecipeProvider( | ||
output: PackOutput, | ||
holderLookup: CompletableFuture<HolderLookup.Provider> | ||
) : RecipeProvider(output, holderLookup) { | ||
override fun buildRecipes(output: RecipeOutput) { | ||
|
||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/earth/terrarium/techarium/datagen/providers/TechariumSoundProvider.kt
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,15 @@ | ||
package earth.terrarium.techarium.datagen.providers | ||
|
||
import earth.terrarium.techarium.common.TechariumConstants | ||
import net.minecraft.data.PackOutput | ||
import net.neoforged.neoforge.common.data.ExistingFileHelper | ||
import net.neoforged.neoforge.common.data.SoundDefinitionsProvider | ||
|
||
class TechariumSoundProvider( | ||
output: PackOutput, | ||
fileHelper: ExistingFileHelper | ||
) : SoundDefinitionsProvider(output, TechariumConstants.MOD_ID, fileHelper) { | ||
override fun registerSounds() { | ||
|
||
} | ||
} |