Add some post lamp crafting recipes

This commit is contained in:
Andrew-71 2024-03-07 12:22:51 +03:00
parent 27eac23401
commit 1b290d9169
13 changed files with 439 additions and 6 deletions

View file

@ -0,0 +1,48 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_lamp_post_base": {
"conditions": {
"items": [
{
"items": [
"new_soviet:lamp_post_base"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_redstone_lamp": {
"conditions": {
"items": [
{
"items": [
"minecraft:redstone_lamp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:big_post_lamp_redstone_lamp"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_lamp_post_base",
"has_redstone_lamp",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:big_post_lamp_redstone_lamp"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,48 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_lamp_post_base": {
"conditions": {
"items": [
{
"items": [
"new_soviet:lamp_post_base"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_sea_lantern": {
"conditions": {
"items": [
{
"items": [
"minecraft:sea_lantern"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:big_post_lamp_sea_lantern"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_lamp_post_base",
"has_sea_lantern",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:big_post_lamp_sea_lantern"
]
},
"sends_telemetry_event": false
}

View file

@ -27,7 +27,7 @@
}, },
"has_the_recipe": { "has_the_recipe": {
"conditions": { "conditions": {
"recipe": "new_soviet:big_post_lamp" "recipe": "new_soviet:big_post_lamp_shroomlight"
}, },
"trigger": "minecraft:recipe_unlocked" "trigger": "minecraft:recipe_unlocked"
} }
@ -41,7 +41,7 @@
], ],
"rewards": { "rewards": {
"recipes": [ "recipes": [
"new_soviet:big_post_lamp" "new_soviet:big_post_lamp_shroomlight"
] ]
}, },
"sends_telemetry_event": false "sends_telemetry_event": false

View file

@ -0,0 +1,61 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_iron_nugget": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_nugget"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_lamp_post_base": {
"conditions": {
"items": [
{
"items": [
"new_soviet:lamp_post_base"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_lantern": {
"conditions": {
"items": [
{
"items": [
"minecraft:lantern"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:caged_post_lamp"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_lamp_post_base",
"has_lantern",
"has_iron_nugget",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:caged_post_lamp"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,61 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_caged_post_lamp": {
"conditions": {
"items": [
{
"items": [
"new_soviet:vintage_post_lamp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_iron_ingot": {
"conditions": {
"items": [
{
"items": [
"new_soviet:vintage_post_lamp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:vintage_post_lamp_add_ingot"
},
"trigger": "minecraft:recipe_unlocked"
},
"has_vintage_post_lamp": {
"conditions": {
"items": [
{
"items": [
"new_soviet:vintage_post_lamp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
}
},
"requirements": [
[
"has_vintage_post_lamp",
"has_caged_post_lamp",
"has_iron_ingot",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:vintage_post_lamp_add_ingot"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,74 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_iron_ingot": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_ingot"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_iron_nugget": {
"conditions": {
"items": [
{
"items": [
"minecraft:iron_nugget"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_lamp_post_base": {
"conditions": {
"items": [
{
"items": [
"new_soviet:lamp_post_base"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_lantern": {
"conditions": {
"items": [
{
"items": [
"minecraft:lantern"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "new_soviet:vintage_post_lamp_basic"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_lamp_post_base",
"has_lantern",
"has_iron_ingot",
"has_iron_nugget",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"new_soviet:vintage_post_lamp_basic"
]
},
"sends_telemetry_event": false
}

View file

@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"P": {
"item": "new_soviet:lamp_post_base"
},
"S": {
"item": "minecraft:redstone_lamp"
}
},
"pattern": [
" S ",
" P ",
" "
],
"result": {
"item": "new_soviet:big_post_lamp"
},
"show_notification": true
}

View file

@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"P": {
"item": "new_soviet:lamp_post_base"
},
"S": {
"item": "minecraft:sea_lantern"
}
},
"pattern": [
" S ",
" P ",
" "
],
"result": {
"item": "new_soviet:big_post_lamp"
},
"show_notification": true
}

View file

@ -0,0 +1,23 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"L": {
"item": "minecraft:lantern"
},
"N": {
"item": "minecraft:iron_nugget"
},
"P": {
"item": "new_soviet:lamp_post_base"
}
},
"pattern": [
" N",
"LP"
],
"result": {
"item": "new_soviet:caged_post_lamp"
},
"show_notification": true
}

View file

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "new_soviet:caged_post_lamp"
},
{
"item": "minecraft:iron_ingot"
}
],
"result": {
"item": "new_soviet:vintage_post_lamp"
}
}

View file

@ -0,0 +1,26 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"I": {
"item": "minecraft:iron_ingot"
},
"L": {
"item": "minecraft:lantern"
},
"N": {
"item": "minecraft:iron_nugget"
},
"P": {
"item": "new_soviet:lamp_post_base"
}
},
"pattern": [
"IN",
"LP"
],
"result": {
"item": "new_soviet:vintage_post_lamp"
},
"show_notification": true
}

View file

@ -5,14 +5,12 @@ import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.data.server.recipe.RecipeJsonProvider; import net.minecraft.data.server.recipe.*;
import net.minecraft.data.server.recipe.RecipeProvider;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder;
import net.minecraft.item.ItemConvertible; import net.minecraft.item.ItemConvertible;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.book.RecipeCategory; import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.registry.Registries;
import net.minecraft.registry.tag.ItemTags; import net.minecraft.registry.tag.ItemTags;
import net.minecraft.util.Util; import net.minecraft.util.Util;
import su.a71.new_soviet.registration.NSE_Blocks; import su.a71.new_soviet.registration.NSE_Blocks;
@ -586,8 +584,45 @@ public class RecipeGenerator extends FabricRecipeProvider {
.pattern(" S ").pattern(" P ").pattern(" ") .pattern(" S ").pattern(" P ").pattern(" ")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE)) .criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.SHROOMLIGHT), conditionsFromItem(Blocks.SHROOMLIGHT)) .criterion(hasItem(Blocks.SHROOMLIGHT), conditionsFromItem(Blocks.SHROOMLIGHT))
.offerTo(exporter, Registries.ITEM.getId(NSE_Custom.BIG_POST_LAMP.asItem()) + "_shroomlight");
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.BIG_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('S', Blocks.SEA_LANTERN)
.pattern(" S ").pattern(" P ").pattern(" ")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.SEA_LANTERN), conditionsFromItem(Blocks.SEA_LANTERN))
.offerTo(exporter, Registries.ITEM.getId(NSE_Custom.BIG_POST_LAMP.asItem()) + "_sea_lantern");
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.BIG_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('S', Blocks.REDSTONE_LAMP)
.pattern(" S ").pattern(" P ").pattern(" ")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.REDSTONE_LAMP), conditionsFromItem(Blocks.REDSTONE_LAMP))
.offerTo(exporter, Registries.ITEM.getId(NSE_Custom.BIG_POST_LAMP.asItem()) + "_redstone_lamp");
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.CAGED_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('N', Items.IRON_NUGGET).input('L', Blocks.LANTERN)
.pattern(" N").pattern("LP")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.LANTERN), conditionsFromItem(Blocks.LANTERN))
.criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET))
.offerTo(exporter); .offerTo(exporter);
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.VINTAGE_POST_LAMP, 1)
.input('P', NSE_Custom.LAMP_POST_BASE).input('N', Items.IRON_NUGGET).input('I', Items.IRON_INGOT).input('L', Blocks.LANTERN)
.pattern("IN").pattern("LP")
.criterion(hasItem(NSE_Custom.LAMP_POST_BASE), conditionsFromItem(NSE_Custom.LAMP_POST_BASE))
.criterion(hasItem(Blocks.LANTERN), conditionsFromItem(Blocks.LANTERN))
.criterion(hasItem(Items.IRON_INGOT), conditionsFromItem(Items.IRON_INGOT))
.criterion(hasItem(Items.IRON_NUGGET), conditionsFromItem(Items.IRON_NUGGET))
.offerTo(exporter, Registries.ITEM.getId(NSE_Custom.VINTAGE_POST_LAMP.asItem()) + "_basic");
ShapelessRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.VINTAGE_POST_LAMP).input(NSE_Custom.CAGED_POST_LAMP).input(Items.IRON_INGOT).criterion(FabricRecipeProvider.hasItem(NSE_Custom.VINTAGE_POST_LAMP),
FabricRecipeProvider.conditionsFromItem(NSE_Custom.VINTAGE_POST_LAMP)).criterion(FabricRecipeProvider.hasItem(NSE_Custom.CAGED_POST_LAMP),
FabricRecipeProvider.conditionsFromItem(NSE_Custom.VINTAGE_POST_LAMP)).criterion(FabricRecipeProvider.hasItem(Items.IRON_INGOT),
FabricRecipeProvider.conditionsFromItem(NSE_Custom.VINTAGE_POST_LAMP)).offerTo(exporter, Registries.ITEM.getId(NSE_Custom.VINTAGE_POST_LAMP.asItem()) + "_add_ingot");
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.SIREN, 1) ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, NSE_Custom.SIREN, 1)
.input('R', Items.REDSTONE).input('N', Blocks.NOTE_BLOCK).input('I', Items.IRON_NUGGET) .input('R', Items.REDSTONE).input('N', Blocks.NOTE_BLOCK).input('I', Items.IRON_NUGGET)
.pattern(" ").pattern("IRI").pattern("NIN") .pattern(" ").pattern("IRI").pattern("NIN")