Skip to content

Commit

Permalink
Fix Recipe Provider not calling generate (#4078)
Browse files Browse the repository at this point in the history
* Fix Recipe Provider not calling generate

* Commit data generated files to repo
  • Loading branch information
modmuss50 authored Sep 10, 2024
1 parent 0771530 commit a3dc8b6
Show file tree
Hide file tree
Showing 48 changed files with 779 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fabric-data-generation-api-v1/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/src/testmod/generated
/src/testmod/generated/.cache
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public CompletableFuture<?> run(DataWriter writer) {
return registriesFuture.thenCompose((wrapperLookup -> {
Set<Identifier> generatedRecipes = Sets.newHashSet();
List<CompletableFuture<?>> list = new ArrayList<>();
getRecipeGenerator(wrapperLookup, new RecipeExporter() {
RecipeGenerator recipeGenerator = getRecipeGenerator(wrapperLookup, new RecipeExporter() {
@Override
public void accept(Identifier recipeId, Recipe<?> recipe, @Nullable AdvancementEntry advancement) {
Identifier identifier = getRecipeIdentifier(recipeId);
Expand Down Expand Up @@ -134,6 +134,7 @@ public Advancement.Builder getAdvancementBuilder() {
public void addRootAdvancement() {
}
});
recipeGenerator.generate();
return CompletableFuture.allOf(list.toArray(CompletableFuture[]::new));
}));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/block_that_drops_nothing"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/block_with_vanilla_loot_table"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/block_without_item"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/block_without_loot_table"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/simple_block"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"attribute.name.armor": "Generic Armor",
"block.fabric-data-gen-api-v1-testmod.simple_block": "Simple Block",
"entity.minecraft.allay": "Allay",
"fabric-data-gen-api-v1-testmod.identifier_test": "Identifier Test",
"itemGroup.fabric-data-gen-api-v1-testmod.default": "Datagen Itemgroup"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"block.fabric-data-gen-api-v1-testmod.simple_block": "シンプルブロック",
"fabric-data-gen-api-v1-testmod.simple_item_group": "データ生成項目",
"this.is.a.test": "こんにちは"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/block_that_drops_nothing"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/block_with_vanilla_loot_table"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/block_without_item"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/block_without_loot_table"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/simple_block"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "fabric-data-gen-api-v1-testmod:block/simple_block"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_log": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "#minecraft:acacia_logs"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "fabric-data-gen-api-v1-testmod:simple_block"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_log"
]
],
"rewards": {
"recipes": [
"fabric-data-gen-api-v1-testmod:simple_block"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_payment": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "#minecraft:beacon_payment_items"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:beacon"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_payment"
]
],
"rewards": {
"recipes": [
"minecraft:beacon"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:true"
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_stick": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "minecraft:stick"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:diamond"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_stick"
]
],
"rewards": {
"recipes": [
"minecraft:diamond"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_pickaxe": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "minecraft:diamond_pickaxe"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:diamond_block"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_pickaxe"
]
],
"rewards": {
"recipes": [
"minecraft:diamond_block"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:registry_contains",
"registry": "minecraft:item",
"values": [
"minecraft:diamond_block"
]
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_frame": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "minecraft:item_frame"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:diamond_ore"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_frame"
]
],
"rewards": {
"recipes": [
"minecraft:diamond_ore"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:registry_contains",
"registry": "minecraft:worldgen/biome",
"values": [
"minecraft:plains",
"minecraft:badlands"
]
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_frame": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "minecraft:item_frame"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:emerald"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_frame"
]
],
"rewards": {
"recipes": [
"minecraft:emerald"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_pickaxe": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "minecraft:golden_pickaxe"
}
]
}
},
"has_shovel": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "minecraft:golden_shovel"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:gold_block"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_pickaxe",
"has_shovel"
]
],
"rewards": {
"recipes": [
"minecraft:gold_block"
]
}
}
Loading

0 comments on commit a3dc8b6

Please sign in to comment.