Fix Recipe Provider not calling generate (#4078)

* Fix Recipe Provider not calling generate

* Commit data generated files to repo
This commit is contained in:
modmuss 2024-09-10 13:17:13 +01:00 committed by GitHub
parent 0771530439
commit a3dc8b6ac6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 779 additions and 2 deletions

View file

@ -1 +1 @@
/src/testmod/generated /src/testmod/generated/.cache

View file

@ -98,7 +98,7 @@ public abstract class FabricRecipeProvider extends RecipeGenerator.RecipeProvide
return registriesFuture.thenCompose((wrapperLookup -> { return registriesFuture.thenCompose((wrapperLookup -> {
Set<Identifier> generatedRecipes = Sets.newHashSet(); Set<Identifier> generatedRecipes = Sets.newHashSet();
List<CompletableFuture<?>> list = new ArrayList<>(); List<CompletableFuture<?>> list = new ArrayList<>();
getRecipeGenerator(wrapperLookup, new RecipeExporter() { RecipeGenerator recipeGenerator = getRecipeGenerator(wrapperLookup, new RecipeExporter() {
@Override @Override
public void accept(Identifier recipeId, Recipe<?> recipe, @Nullable AdvancementEntry advancement) { public void accept(Identifier recipeId, Recipe<?> recipe, @Nullable AdvancementEntry advancement) {
Identifier identifier = getRecipeIdentifier(recipeId); Identifier identifier = getRecipeIdentifier(recipeId);
@ -134,6 +134,7 @@ public abstract class FabricRecipeProvider extends RecipeGenerator.RecipeProvide
public void addRootAdvancement() { public void addRootAdvancement() {
} }
}); });
recipeGenerator.generate();
return CompletableFuture.allOf(list.toArray(CompletableFuture[]::new)); return CompletableFuture.allOf(list.toArray(CompletableFuture[]::new));
})); }));
} }

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/block_that_drops_nothing"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/block_with_vanilla_loot_table"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/block_without_item"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/block_without_loot_table"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "fabric-data-gen-api-v1-testmod:block/simple_block"
}
}
}

View file

@ -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"
}

View file

@ -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": "こんにちは"
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/block_that_drops_nothing"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/block_with_vanilla_loot_table"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/block_without_item"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/block_without_loot_table"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "fabric-data-gen-api-v1-testmod:block/simple_block"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "fabric-data-gen-api-v1-testmod:block/simple_block"
}

View file

@ -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"
]
}
}

View file

@ -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"
]
}
}

View file

@ -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"
]
}
}

View file

@ -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"
]
}
}

View file

@ -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"
]
}
}

View file

@ -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"
]
}
}

View file

@ -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"
]
}
}

View file

@ -0,0 +1,40 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:not",
"value": {
"condition": "fabric:true"
}
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_dirt": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "minecraft:dirt"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:gold_ingot"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_dirt"
]
],
"rewards": {
"recipes": [
"minecraft:gold_ingot"
]
}
}

View file

@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_charcoal": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": "minecraft:charcoal"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:torch"
}
}
},
"requirements": [
[
"has_the_recipe",
"has_charcoal"
]
],
"rewards": {
"recipes": [
"minecraft:torch"
]
}
}

View file

@ -0,0 +1,28 @@
{
"criteria": {
"killed_something": {
"trigger": "minecraft:player_killed_entity"
}
},
"display": {
"announce_to_chat": false,
"background": "minecraft:textures/gui/advancements/backgrounds/end.png",
"description": {
"translate": "advancements.test.root.description"
},
"icon": {
"count": 1,
"id": "fabric-data-gen-api-v1-testmod:simple_block"
},
"show_toast": false,
"title": {
"translate": "advancements.test.root.title"
}
},
"requirements": [
[
"killed_something"
]
],
"sends_telemetry_event": true
}

View file

@ -0,0 +1,36 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:not",
"value": {
"condition": "fabric:true"
}
}
],
"criteria": {
"killed_something": {
"trigger": "minecraft:player_killed_entity"
}
},
"display": {
"announce_to_chat": false,
"background": "minecraft:textures/gui/advancements/backgrounds/end.png",
"description": {
"translate": "advancements.test.root_not_loaded.description"
},
"icon": {
"count": 1,
"id": "fabric-data-gen-api-v1-testmod:simple_block"
},
"show_toast": false,
"title": {
"translate": "advancements.test.root_not_loaded.title"
}
},
"requirements": [
[
"killed_something"
]
],
"sends_telemetry_event": true
}

View file

@ -0,0 +1,11 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"fabric-data-gen-api-v1-testmod"
]
}
],
"value": ":tiny_potato:"
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "fabric-data-gen-api-v1-testmod:simple_block"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,34 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:not",
"value": {
"condition": "fabric:not",
"value": {
"condition": "fabric:true"
}
}
},
{
"condition": "fabric:true"
}
],
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "fabric-data-gen-api-v1-testmod:simple_block"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,4 @@
{
"block": "minecraft:melon",
"condition": "minecraft:block_state_property"
}

View file

@ -0,0 +1,25 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"fabric:type": "fabric:difference",
"base": {
"fabric:type": "fabric:any",
"ingredients": [
"#minecraft:beacon_payment_items",
"minecraft:copper_ingot"
]
},
"subtracted": [
"minecraft:iron_ingot",
"minecraft:gold_ingot",
"minecraft:diamond"
]
}
],
"result": {
"count": 1,
"id": "minecraft:beacon"
}
}

View file

@ -0,0 +1,16 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:true"
}
],
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
"minecraft:stick"
],
"result": {
"count": 1,
"id": "minecraft:diamond"
}
}

View file

@ -0,0 +1,25 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
"minecraft:diamond_pickaxe",
"minecraft:diamond_pickaxe",
"minecraft:diamond_pickaxe",
"minecraft:diamond_pickaxe",
{
"fabric:type": "fabric:components",
"base": "minecraft:diamond_pickaxe",
"components": {
"minecraft:damage": 0
}
},
"minecraft:diamond_pickaxe",
"minecraft:diamond_pickaxe",
"minecraft:diamond_pickaxe",
"minecraft:diamond_pickaxe"
],
"result": {
"count": 1,
"id": "minecraft:diamond_block"
}
}

View file

@ -0,0 +1,20 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:registry_contains",
"registry": "minecraft:item",
"values": [
"minecraft:diamond_block"
]
}
],
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
"minecraft:item_frame"
],
"result": {
"count": 4,
"id": "minecraft:diamond_ore"
}
}

View file

@ -0,0 +1,22 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:registry_contains",
"registry": "minecraft:worldgen/biome",
"values": [
"minecraft:plains",
"minecraft:badlands"
]
}
],
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
"minecraft:item_frame",
"minecraft:item_frame"
],
"result": {
"count": 4,
"id": "minecraft:emerald"
}
}

View file

@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"fabric:type": "fabric:any",
"ingredients": [
"minecraft:golden_pickaxe",
"minecraft:golden_shovel"
]
}
],
"result": {
"count": 1,
"id": "minecraft:gold_block"
}
}

View file

@ -0,0 +1,19 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:not",
"value": {
"condition": "fabric:true"
}
}
],
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
"minecraft:dirt"
],
"result": {
"count": 1,
"id": "minecraft:gold_ingot"
}
}

View file

@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shapeless",
"category": "building",
"group": "planks",
"ingredients": [
"#minecraft:acacia_logs"
],
"result": {
"count": 1,
"id": "fabric-data-gen-api-v1-testmod:simple_block"
}
}

View file

@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"fabric:type": "fabric:all",
"ingredients": [
"#minecraft:coals",
"minecraft:charcoal"
]
}
],
"result": {
"count": 1,
"id": "minecraft:torch"
}
}

View file

@ -0,0 +1,7 @@
{
"values": [
"minecraft:badlands",
"minecraft:bamboo_jungle",
"minecraft:basalt_deltas"
]
}

View file

@ -0,0 +1,20 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:true"
}
],
"type": "minecraft:barter",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "fabric-data-gen-api-v1-testmod:simple_block"
}
],
"rolls": 1.0
}
]
}

View file

@ -0,0 +1,5 @@
{
"values": [
"#minecraft:animals_spawnable_on"
]
}

View file

@ -0,0 +1,5 @@
{
"values": [
"fabric-data-gen-api-v1-testmod:simple_block"
]
}

View file

@ -0,0 +1,6 @@
{
"replace": true,
"values": [
"fabric-data-gen-api-v1-testmod:simple_block"
]
}

View file

@ -0,0 +1,5 @@
{
"values": [
"fabric-data-gen-api-v1-testmod:simple_block"
]
}