Skip to content

Commit

Permalink
Add Sky Bronze material for MEGA fluid cells
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Jul 13, 2024
1 parent 6aa256a commit 658f13e
Show file tree
Hide file tree
Showing 39 changed files with 315 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ public static void onGatherData(GatherDataEvent event) {
var registries = event.getLookupProvider();
generator.addProvider(event.includeServer(), new MEGARecipeProvider(output, registries));
generator.addProvider(event.includeServer(), new MEGALootProvider(output, registries));
generator.addProvider(event.includeServer(), new MEGATagProvider.BlockTags(output, registries, existing));
generator.addProvider(event.includeServer(), new MEGATagProvider.ItemTags(output, registries, existing));

var blockTags = new MEGATagProvider.BlockTags(output, registries, existing);
generator.addProvider(event.includeServer(), blockTags);
generator.addProvider(
event.includeServer(),
new MEGATagProvider.ItemTags(output, registries, blockTags.contentsGetter(), existing));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public MEGAModelProvider(PackOutput output, ExistingFileHelper existing) {
@Override
protected void registerStatesAndModels() {
basicItem(MEGAItems.SKY_STEEL_INGOT);
basicItem(MEGAItems.SKY_BRONZE_INGOT);

basicItem(MEGAItems.ACCUMULATION_PROCESSOR);
basicItem(MEGAItems.ACCUMULATION_PROCESSOR_PRINT);
Expand Down Expand Up @@ -85,6 +86,7 @@ protected void registerStatesAndModels() {
craftingPattern);

simpleBlockWithItem(MEGABlocks.SKY_STEEL_BLOCK.block(), cubeAll(MEGABlocks.SKY_STEEL_BLOCK.block()));
simpleBlockWithItem(MEGABlocks.SKY_BRONZE_BLOCK.block(), cubeAll(MEGABlocks.SKY_BRONZE_BLOCK.block()));
simpleBlockWithItem(MEGABlocks.MEGA_INTERFACE.block(), cubeAll(MEGABlocks.MEGA_INTERFACE.block()));

interfaceOrProviderPart(MEGAItems.MEGA_INTERFACE);
Expand Down
43 changes: 32 additions & 11 deletions src/data/java/gripe/_90/megacells/datagen/MEGARecipeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ protected void buildRecipes(@NotNull RecipeOutput output) {
component(output, MEGAItems.TIER_256M, MEGAItems.TIER_64M, AEItems.MATTER_BALL.asItem(), null);

housing(output, MEGAItems.MEGA_ITEM_CELL_HOUSING, MEGATags.SKY_STEEL_INGOT);
housing(output, MEGAItems.MEGA_FLUID_CELL_HOUSING, ConventionTags.COPPER_INGOT);
housing(output, MEGAItems.MEGA_FLUID_CELL_HOUSING, MEGATags.SKY_BRONZE_INGOT);

cell(output, MEGAItems.ITEM_CELL_1M, MEGAItems.CELL_COMPONENT_1M, MEGAItems.MEGA_ITEM_CELL_HOUSING, ConventionTags.IRON_INGOT);
cell(output, MEGAItems.ITEM_CELL_4M, MEGAItems.CELL_COMPONENT_4M, MEGAItems.MEGA_ITEM_CELL_HOUSING, ConventionTags.IRON_INGOT);
cell(output, MEGAItems.ITEM_CELL_16M, MEGAItems.CELL_COMPONENT_16M, MEGAItems.MEGA_ITEM_CELL_HOUSING, ConventionTags.IRON_INGOT);
cell(output, MEGAItems.ITEM_CELL_64M, MEGAItems.CELL_COMPONENT_64M, MEGAItems.MEGA_ITEM_CELL_HOUSING, ConventionTags.IRON_INGOT);
cell(output, MEGAItems.ITEM_CELL_256M, MEGAItems.CELL_COMPONENT_256M, MEGAItems.MEGA_ITEM_CELL_HOUSING, ConventionTags.IRON_INGOT);
cell(output, MEGAItems.ITEM_CELL_1M, MEGAItems.CELL_COMPONENT_1M, MEGAItems.MEGA_ITEM_CELL_HOUSING, MEGATags.SKY_STEEL_INGOT);
cell(output, MEGAItems.ITEM_CELL_4M, MEGAItems.CELL_COMPONENT_4M, MEGAItems.MEGA_ITEM_CELL_HOUSING, MEGATags.SKY_STEEL_INGOT);
cell(output, MEGAItems.ITEM_CELL_16M, MEGAItems.CELL_COMPONENT_16M, MEGAItems.MEGA_ITEM_CELL_HOUSING, MEGATags.SKY_STEEL_INGOT);
cell(output, MEGAItems.ITEM_CELL_64M, MEGAItems.CELL_COMPONENT_64M, MEGAItems.MEGA_ITEM_CELL_HOUSING, MEGATags.SKY_STEEL_INGOT);
cell(output, MEGAItems.ITEM_CELL_256M, MEGAItems.CELL_COMPONENT_256M, MEGAItems.MEGA_ITEM_CELL_HOUSING, MEGATags.SKY_STEEL_INGOT);

cell(output, MEGAItems.FLUID_CELL_1M, MEGAItems.CELL_COMPONENT_1M, MEGAItems.MEGA_FLUID_CELL_HOUSING, ConventionTags.COPPER_INGOT);
cell(output, MEGAItems.FLUID_CELL_4M, MEGAItems.CELL_COMPONENT_4M, MEGAItems.MEGA_FLUID_CELL_HOUSING, ConventionTags.COPPER_INGOT);
cell(output, MEGAItems.FLUID_CELL_16M, MEGAItems.CELL_COMPONENT_16M, MEGAItems.MEGA_FLUID_CELL_HOUSING, ConventionTags.COPPER_INGOT);
cell(output, MEGAItems.FLUID_CELL_64M, MEGAItems.CELL_COMPONENT_64M, MEGAItems.MEGA_FLUID_CELL_HOUSING, ConventionTags.COPPER_INGOT);
cell(output, MEGAItems.FLUID_CELL_256M, MEGAItems.CELL_COMPONENT_256M, MEGAItems.MEGA_FLUID_CELL_HOUSING, ConventionTags.COPPER_INGOT);
cell(output, MEGAItems.FLUID_CELL_1M, MEGAItems.CELL_COMPONENT_1M, MEGAItems.MEGA_FLUID_CELL_HOUSING, MEGATags.SKY_BRONZE_INGOT);
cell(output, MEGAItems.FLUID_CELL_4M, MEGAItems.CELL_COMPONENT_4M, MEGAItems.MEGA_FLUID_CELL_HOUSING, MEGATags.SKY_BRONZE_INGOT);
cell(output, MEGAItems.FLUID_CELL_16M, MEGAItems.CELL_COMPONENT_16M, MEGAItems.MEGA_FLUID_CELL_HOUSING, MEGATags.SKY_BRONZE_INGOT);
cell(output, MEGAItems.FLUID_CELL_64M, MEGAItems.CELL_COMPONENT_64M, MEGAItems.MEGA_FLUID_CELL_HOUSING, MEGATags.SKY_BRONZE_INGOT);
cell(output, MEGAItems.FLUID_CELL_256M, MEGAItems.CELL_COMPONENT_256M, MEGAItems.MEGA_FLUID_CELL_HOUSING, MEGATags.SKY_BRONZE_INGOT);

portable(output, MEGAItems.PORTABLE_ITEM_CELL_1M, MEGAItems.CELL_COMPONENT_1M, MEGAItems.MEGA_ITEM_CELL_HOUSING);
portable(output, MEGAItems.PORTABLE_ITEM_CELL_4M, MEGAItems.CELL_COMPONENT_4M, MEGAItems.MEGA_ITEM_CELL_HOUSING);
Expand All @@ -95,6 +95,18 @@ protected void buildRecipes(@NotNull RecipeOutput output) {
.unlockedBy("has_sky_steel_ingot", has(MEGATags.SKY_STEEL_INGOT))
.save(output, MEGACells.makeId("crafting/sky_steel_ingot_from_sky_steel_block"));

ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, MEGABlocks.SKY_BRONZE_BLOCK)
.pattern("###")
.pattern("###")
.pattern("###")
.define('#', MEGATags.SKY_BRONZE_INGOT)
.unlockedBy("has_sky_bronze_ingot", has(MEGATags.SKY_BRONZE_INGOT))
.save(output, MEGACells.makeId("crafting/sky_bronze_block"));
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, MEGAItems.SKY_BRONZE_INGOT, 9)
.requires(MEGABlocks.SKY_BRONZE_BLOCK)
.unlockedBy("has_sky_bronze_ingot", has(MEGATags.SKY_BRONZE_INGOT))
.save(output, MEGACells.makeId("crafting/sky_bronze_ingot_from_sky_bronze_block"));

TransformRecipeBuilder.transform(
output,
MEGACells.makeId("transform/sky_steel_ingot"),
Expand All @@ -104,6 +116,15 @@ protected void buildRecipes(@NotNull RecipeOutput output) {
Ingredient.of(AEItems.CERTUS_QUARTZ_CRYSTAL_CHARGED),
Ingredient.of(ConventionTags.IRON_INGOT),
Ingredient.of(AEBlocks.SKY_STONE_BLOCK));
TransformRecipeBuilder.transform(
output,
MEGACells.makeId("transform/sky_bronze_ingot"),
MEGAItems.SKY_BRONZE_INGOT,
2,
TransformCircumstance.fluid(FluidTags.LAVA),
Ingredient.of(AEItems.CERTUS_QUARTZ_CRYSTAL_CHARGED),
Ingredient.of(ConventionTags.COPPER_INGOT),
Ingredient.of(AEBlocks.SKY_STONE_BLOCK));

InscriberRecipeBuilder.inscribe(AEItems.SINGULARITY, MEGAItems.ACCUMULATION_PROCESSOR_PRESS, 1)
.setTop(Ingredient.of(AEItems.CALCULATION_PROCESSOR_PRESS))
Expand Down
71 changes: 37 additions & 34 deletions src/data/java/gripe/_90/megacells/datagen/MEGATagProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import net.minecraft.core.registries.Registries;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.IntrinsicHolderTagsProvider;
import net.minecraft.data.tags.ItemTagsProvider;
import net.minecraft.data.tags.TagsProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
Expand All @@ -23,22 +25,51 @@
import gripe._90.megacells.definition.MEGATags;

public class MEGATagProvider {
public static class ItemTags extends IntrinsicHolderTagsProvider<Item> {
public ItemTags(
public static class BlockTags extends IntrinsicHolderTagsProvider<Block> {
public BlockTags(
PackOutput output, CompletableFuture<HolderLookup.Provider> registries, ExistingFileHelper existing) {
super(
output,
Registries.ITEM,
Registries.BLOCK,
registries,
item -> BuiltInRegistries.ITEM.getResourceKey(item).orElseThrow(),
block -> BuiltInRegistries.BLOCK.getResourceKey(block).orElseThrow(),
MEGACells.MODID,
existing);
}

@Override
protected void addTags(@NotNull HolderLookup.Provider provider) {
for (var block : MEGABlocks.getBlocks()) {
tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(block.block());
}

tag(MEGATags.SKY_STEEL_BLOCK).add(MEGABlocks.SKY_STEEL_BLOCK.block());
tag(MEGATags.SKY_BRONZE_BLOCK).add(MEGABlocks.SKY_BRONZE_BLOCK.block());
}

@NotNull
@Override
public String getName() {
return "Tags (Block)";
}
}

public static class ItemTags extends ItemTagsProvider {
public ItemTags(
PackOutput output,
CompletableFuture<HolderLookup.Provider> registries,
CompletableFuture<TagsProvider.TagLookup<Block>> blockTags,
ExistingFileHelper existing) {
super(output, registries, blockTags, MEGACells.MODID, existing);
}

@Override
protected void addTags(@NotNull HolderLookup.Provider provider) {
copy(MEGATags.SKY_STEEL_BLOCK, TagKey.create(Registries.ITEM, MEGATags.SKY_STEEL_BLOCK.location()));
copy(MEGATags.SKY_BRONZE_BLOCK, TagKey.create(Registries.ITEM, MEGATags.SKY_BRONZE_BLOCK.location()));

tag(MEGATags.SKY_STEEL_INGOT).add(MEGAItems.SKY_STEEL_INGOT.asItem());
tag(MEGATags.SKY_STEEL_BLOCK_ITEM).add(MEGABlocks.SKY_STEEL_BLOCK.asItem());
tag(MEGATags.SKY_BRONZE_INGOT).add(MEGAItems.SKY_BRONZE_INGOT.asItem());

tag(P2PTunnelAttunement.getAttunementTag(P2PTunnelAttunement.ENERGY_TUNNEL))
.add(MEGABlocks.MEGA_ENERGY_CELL.asItem());
Expand All @@ -65,32 +96,4 @@ public String getName() {
return "Tags (Item)";
}
}

public static class BlockTags extends IntrinsicHolderTagsProvider<Block> {
public BlockTags(
PackOutput output, CompletableFuture<HolderLookup.Provider> registries, ExistingFileHelper existing) {
super(
output,
Registries.BLOCK,
registries,
block -> BuiltInRegistries.BLOCK.getResourceKey(block).orElseThrow(),
MEGACells.MODID,
existing);
}

@Override
protected void addTags(@NotNull HolderLookup.Provider provider) {
for (var block : MEGABlocks.getBlocks()) {
tag(net.minecraft.tags.BlockTags.MINEABLE_WITH_PICKAXE).add(block.block());
}

tag(MEGATags.SKY_STEEL_BLOCK).add(MEGABlocks.SKY_STEEL_BLOCK.block());
}

@NotNull
@Override
public String getName() {
return "Tags (Block)";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// 1.21 2024-07-13T20:04:03.084570139 Tags (Block)
// 1.21 2024-07-13T20:43:00.381237585 Tags (Block)
d16fe455331319a8d365af59139ac5d88a119144 data/forge/tags/block/storage_blocks/sky_bronze.json
1bfe8421078982de39dc3cb1d5917d6385175b44 data/forge/tags/block/storage_blocks/sky_steel.json
21ceb061778c604a5d7629b66810bdeb6cf4b50f data/minecraft/tags/block/mineable/pickaxe.json
9a0d5c48503300fcb9f617422569b4a65895a056 data/minecraft/tags/block/mineable/pickaxe.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.21 2024-07-13T20:04:03.083433179 Loot Tables
// 1.21 2024-07-13T20:28:57.673201084 Loot Tables
707d0eccda1635750a24b8e2c508c9697b5bcee8 data/megacells/loot_table/blocks/16m_crafting_storage.json
9383058b7682f02218b366dfa83b4932679957ed data/megacells/loot_table/blocks/1m_crafting_storage.json
921f9b4082cf3a018df4d23e15d3e0ac293e2c07 data/megacells/loot_table/blocks/256m_crafting_storage.json
Expand All @@ -10,4 +10,5 @@ b960beab6b922cccf4e34d20a2654ae5e5f14ce4 data/megacells/loot_table/blocks/64m_cr
3367c57fcd1c21ba43d54702f4dab4bb0bd560d9 data/megacells/loot_table/blocks/mega_energy_cell.json
081145e945afcaf36cbd0f3a526f5f8700ad7c98 data/megacells/loot_table/blocks/mega_interface.json
b6cf66f67b61f4fc8737f32b9a2e275da641502f data/megacells/loot_table/blocks/mega_pattern_provider.json
0c6464bb5b798541059247715ecfa9d53cdfdeb1 data/megacells/loot_table/blocks/sky_bronze_block.json
e0e08740ef7b4e7d30181ef36015058ec1535116 data/megacells/loot_table/blocks/sky_steel_block.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 1.21 2024-07-13T20:04:03.083209449 Tags (Item)
// 1.21 2024-07-13T20:45:39.054049857 Tags (Item)
e42fb28c86b642b8733975efead834402f7fe45b data/ae2/tags/item/p2p_attunements/fe_p2p_tunnel.json
61e4876c9c48d312a89177d6a5c81319297777ac data/forge/tags/item/ingots/sky_bronze.json
39b471400d5e4d6b128765929d0fb819eb462fb5 data/forge/tags/item/ingots/sky_steel.json
d16fe455331319a8d365af59139ac5d88a119144 data/forge/tags/item/storage_blocks/sky_bronze.json
1bfe8421078982de39dc3cb1d5917d6385175b44 data/forge/tags/item/storage_blocks/sky_steel.json
99c21c9a0d2d3ed906e8580c0e1752315f114ba6 data/megacells/tags/item/compression_overrides.json
6945345eddaa46dddeb49da1543ec0850f03278a data/megacells/tags/item/mega_interface.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21 2024-07-13T20:04:03.082807199 Language
9700ca4eafdcac2cf9cb030f1e67e67d0532a7ed assets/megacells/lang/en_us.json
// 1.21 2024-07-13T20:28:57.672363964 Language
8bd1c92aec8ebe92347ab4854d69e041e45bb483 assets/megacells/lang/en_us.json
Loading

0 comments on commit 658f13e

Please sign in to comment.