Skip to content

Commit c6b6283

Browse files
committed
Fixed our conditional recipes and the automata_core recipe with the nbt ingredient
1 parent d01faba commit c6b6283

8 files changed

Lines changed: 157 additions & 8 deletions

File tree

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ dependencies {
209209

210210
// Refined Storage
211211
compileOnly "curse.maven:refined-storage-243076:${refinedstorage_version}"
212-
// Comment this when you want to run runServer since refined storage is just annoying just like its API
213-
//runtimeOnly "curse.maven:refined-storage-243076:${refinedstorage_version}"
212+
runtimeOnly "curse.maven:refined-storage-243076:${refinedstorage_version}"
214213

215214
// AE2 Things
216215
//compileOnly "curse.maven:ae2things-609977:${ae2things_version}-sources"

src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// 1.20.4 2024-12-22T16:09:31.6915779 Recipes
1+
// 1.20.4 2024-12-26T22:13:53.2984235 Recipes
22
81b2ee485995edeeb21c577d141a3fb3008561a4 data/advancedperipherals/advancements/recipes/redstone/block_reader.json
33
4900b8e92c78828e42f434730ad93917bb298a4a data/advancedperipherals/advancements/recipes/redstone/chat_box.json
44
397a6604bd3c093806aac1eabaa30819a83362ce data/advancedperipherals/advancements/recipes/redstone/chunk_controller.json
@@ -8,13 +8,15 @@
88
3bafb8fde05ec490e8f0211b0e97382fe713c08e data/advancedperipherals/advancements/recipes/redstone/geo_scanner.json
99
6f48a77e11a886df80c6672a514bd320915c9dee data/advancedperipherals/advancements/recipes/redstone/inventory_manager.json
1010
7e27b6eb8d0d192dc319f646ba6447d2c9f4bd01 data/advancedperipherals/advancements/recipes/redstone/memory_card.json
11+
e43499b6608246efc710214f24aa8c0ec4a65188 data/advancedperipherals/advancements/recipes/redstone/me_bridge.json
1112
6550380146553418c22f70bef035aa7948fe58c5 data/advancedperipherals/advancements/recipes/redstone/nbt_storage.json
1213
60949a6e0f4e50aee869fe617c256673b37e05f6 data/advancedperipherals/advancements/recipes/redstone/overpowered_end_automata_core.json
1314
f7aaa36a885ee058e357422ef3261ed2e0e06c2f data/advancedperipherals/advancements/recipes/redstone/overpowered_husbandry_automata_core.json
1415
6f8a6c4e74a4208915ec1f4c0065d62294c67c15 data/advancedperipherals/advancements/recipes/redstone/overpowered_weak_automata_core.json
1516
1b08adf8952253e016be01157f749f6ab1bd3f0d data/advancedperipherals/advancements/recipes/redstone/peripheral_casing.json
1617
6cefb0700ed4ff952ade60ca4ef9e48a9c0ff3fb data/advancedperipherals/advancements/recipes/redstone/player_detector.json
1718
8f28aab37ae3dd8935ba3f827f2f0b1101852565 data/advancedperipherals/advancements/recipes/redstone/redstone_integrator.json
19+
66277f490809169783247e32f37b501be83dfa6c data/advancedperipherals/advancements/recipes/redstone/rs_bridge.json
1820
712fb0a23a9ab7cadab8bd05175c247a0b5295b4 data/advancedperipherals/advancements/recipes/redstone/weak_automata_core.json
1921
f8acf88364459d1b38a9ac0fc3a2e87821f98edf data/advancedperipherals/recipes/block_reader.json
2022
b1f3b9f50e62e2f53b23ad14248cb91acb745c37 data/advancedperipherals/recipes/chat_box.json
@@ -25,11 +27,13 @@ a39d46363291e5d98a8b96e17bfcfd44fbe3789d data/advancedperipherals/recipes/comput
2527
4bf49ae496c60e5487c1e87013ef25e14bb13e3a data/advancedperipherals/recipes/geo_scanner.json
2628
2eb633f159ac1b9feaffab383548f56b573f1519 data/advancedperipherals/recipes/inventory_manager.json
2729
dbefebf13084fce55660cffabb955f25901a30f9 data/advancedperipherals/recipes/memory_card.json
30+
f270bf14c921f717d294d8009356deeabf403053 data/advancedperipherals/recipes/me_bridge.json
2831
fddcb2d34c37f4fd5834e077efd27f2cb6127c73 data/advancedperipherals/recipes/nbt_storage.json
2932
afb8673c5643adbbf69a469776ac4cd908ab17e8 data/advancedperipherals/recipes/overpowered_end_automata_core.json
3033
7c98974c9e5999b0186011ff7f910ae2b3cc76b6 data/advancedperipherals/recipes/overpowered_husbandry_automata_core.json
3134
40110dc9c8616e5c9b30b087cfc2f9254c433025 data/advancedperipherals/recipes/overpowered_weak_automata_core.json
3235
346dd97a088087077c157c29cb1ac7b25b0a0cef data/advancedperipherals/recipes/peripheral_casing.json
3336
cba141d36a134a03ae91869abb91c9695bd92898 data/advancedperipherals/recipes/player_detector.json
3437
d5a72afad727dd9814f4c8ef6b177a0db0bc9989 data/advancedperipherals/recipes/redstone_integrator.json
35-
a0945caf9e8bd2921a1095fd5ffaf3f22790fa46 data/advancedperipherals/recipes/weak_automata_core.json
38+
6354df82d465eba4f7f6c2bedf744a97bd6c8de6 data/advancedperipherals/recipes/rs_bridge.json
39+
96aadb6d4a930083832331a5ad6f1b7970fa4cc7 data/advancedperipherals/recipes/weak_automata_core.json
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"neoforge:conditions": [
3+
{
4+
"type": "neoforge:mod_loaded",
5+
"modid": "ae2"
6+
}
7+
],
8+
"parent": "minecraft:recipes/root",
9+
"criteria": {
10+
"has_item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"advancedperipherals:peripheral_casing"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
},
22+
"has_the_recipe": {
23+
"conditions": {
24+
"recipe": "advancedperipherals:me_bridge"
25+
},
26+
"trigger": "minecraft:recipe_unlocked"
27+
}
28+
},
29+
"requirements": [
30+
[
31+
"has_the_recipe",
32+
"has_item"
33+
]
34+
],
35+
"rewards": {
36+
"recipes": [
37+
"advancedperipherals:me_bridge"
38+
]
39+
}
40+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"neoforge:conditions": [
3+
{
4+
"type": "neoforge:mod_loaded",
5+
"modid": "refinedstorage"
6+
}
7+
],
8+
"parent": "minecraft:recipes/root",
9+
"criteria": {
10+
"has_item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"advancedperipherals:peripheral_casing"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
},
22+
"has_the_recipe": {
23+
"conditions": {
24+
"recipe": "advancedperipherals:rs_bridge"
25+
},
26+
"trigger": "minecraft:recipe_unlocked"
27+
}
28+
},
29+
"requirements": [
30+
[
31+
"has_the_recipe",
32+
"has_item"
33+
]
34+
],
35+
"rewards": {
36+
"recipes": [
37+
"advancedperipherals:rs_bridge"
38+
]
39+
}
40+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"neoforge:conditions": [
3+
{
4+
"type": "neoforge:mod_loaded",
5+
"modid": "ae2"
6+
}
7+
],
8+
"type": "minecraft:crafting_shaped",
9+
"category": "redstone",
10+
"key": {
11+
"A": {
12+
"item": "advancedperipherals:peripheral_casing"
13+
},
14+
"F": {
15+
"item": "ae2:fluix_block"
16+
},
17+
"I": {
18+
"item": "ae2:interface"
19+
}
20+
},
21+
"pattern": [
22+
"FIF",
23+
"IAI",
24+
"FIF"
25+
],
26+
"result": {
27+
"item": "advancedperipherals:me_bridge"
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"neoforge:conditions": [
3+
{
4+
"type": "neoforge:mod_loaded",
5+
"modid": "refinedstorage"
6+
}
7+
],
8+
"type": "minecraft:crafting_shaped",
9+
"category": "redstone",
10+
"key": {
11+
"A": {
12+
"item": "advancedperipherals:peripheral_casing"
13+
},
14+
"I": {
15+
"item": "refinedstorage:interface"
16+
},
17+
"Q": {
18+
"item": "refinedstorage:quartz_enriched_iron"
19+
}
20+
},
21+
"pattern": [
22+
"QIQ",
23+
"IAI",
24+
"QIQ"
25+
],
26+
"result": {
27+
"item": "advancedperipherals:rs_bridge"
28+
}
29+
}

src/generated/resources/data/advancedperipherals/recipes/weak_automata_core.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"tag": "forge:gems/diamond"
1010
},
1111
"L": {
12-
"item": "minecraft:potion"
12+
"type": "neoforge:nbt",
13+
"item": "minecraft:potion",
14+
"strict": true,
15+
"tag": "{Potion:\"minecraft:long_regeneration\"}"
1316
},
1417
"R": {
1518
"tag": "forge:storage_blocks/redstone"

src/main/java/de/srendi/advancedperipherals/common/data/RecipesProvider.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package de.srendi.advancedperipherals.common.data;
22

3+
import appeng.core.definitions.AEBlocks;
4+
import com.refinedmods.refinedstorage.RSBlocks;
5+
import com.refinedmods.refinedstorage.RSItems;
36
import dan200.computercraft.shared.ModRegistry;
7+
import de.srendi.advancedperipherals.common.addons.APAddons;
48
import de.srendi.advancedperipherals.common.setup.Blocks;
59
import net.minecraft.data.PackOutput;
610
import net.minecraft.data.recipes.RecipeCategory;
@@ -16,6 +20,7 @@
1620
import net.minecraft.world.level.block.Block;
1721
import net.neoforged.neoforge.common.Tags;
1822
import net.neoforged.neoforge.common.conditions.IConditionBuilder;
23+
import net.neoforged.neoforge.common.conditions.ModLoadedCondition;
1924
import net.neoforged.neoforge.common.crafting.NBTIngredient;
2025

2126
public class RecipesProvider extends RecipeProvider implements IConditionBuilder {
@@ -58,11 +63,11 @@ protected void buildRecipes(RecipeOutput recipeOutput) {
5863

5964
ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.NBT_STORAGE.get()).define('C', Tags.Items.CHESTS).define('A', CASING).define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE).define('I', Tags.Items.INGOTS_IRON).pattern("ICI").pattern("CAC").pattern("RCR").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput);
6065

61-
//ConditionalRecipe.builder().addCondition(modLoaded("ae2")).addRecipe(ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.ME_BRIDGE.get()).define('F', AEBlocks.FLUIX_BLOCK.asItem()).define('A', CASING).define('I', AEBlocks.INTERFACE.asItem()).pattern("FIF").pattern("IAI").pattern("FIF").unlockedBy(HAS_ITEM, has(CASING))::save).build(consumer, new ResourceLocation(AdvancedPeripherals.MOD_ID, "me_bridge"));
66+
ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.ME_BRIDGE.get()).define('F', AEBlocks.FLUIX_BLOCK.asItem()).define('A', CASING).define('I', AEBlocks.INTERFACE.asItem()).pattern("FIF").pattern("IAI").pattern("FIF").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput.withConditions(new ModLoadedCondition(APAddons.AE2_MODID)));
6267

63-
//ConditionalRecipe.builder().addCondition(modLoaded("refinedstorage")).addRecipe(ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.RS_BRIDGE.get()).define('Q', RSItems.QUARTZ_ENRICHED_IRON.get()).define('A', CASING).define('I', RSBlocks.INTERFACE.get()).pattern("QIQ").pattern("IAI").pattern("QIQ").unlockedBy(HAS_ITEM, has(CASING))::save).build(consumer, new ResourceLocation(AdvancedPeripherals.MOD_ID, "rs_bridge"));
68+
ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, Blocks.RS_BRIDGE.get()).define('Q', RSItems.QUARTZ_ENRICHED_IRON.get()).define('A', CASING).define('I', RSBlocks.INTERFACE.get()).pattern("QIQ").pattern("IAI").pattern("QIQ").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput.withConditions(new ModLoadedCondition(APAddons.REFINEDSTORAGE_MODID)));
6469

65-
ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get()).define('A', CASING).define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE).define('S', Items.SOUL_LANTERN).define('D', Tags.Items.GEMS_DIAMOND).define('L', NBTIngredient.of(PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.LONG_REGENERATION))).pattern("RAR").pattern("DSD").pattern("RLR").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput);
70+
ShapedRecipeBuilder.shaped(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get()).define('A', CASING).define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE).define('S', Items.SOUL_LANTERN).define('D', Tags.Items.GEMS_DIAMOND).define('L', NBTIngredient.of(true, PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.LONG_REGENERATION))).pattern("RAR").pattern("DSD").pattern("RLR").unlockedBy(HAS_ITEM, has(CASING)).save(recipeOutput);
6671

6772
ShapelessRecipeBuilder.shapeless(RecipeCategory.REDSTONE, de.srendi.advancedperipherals.common.setup.Items.OVERPOWERED_WEAK_AUTOMATA_CORE.get()).requires(de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get()).requires(Items.NETHER_STAR).unlockedBy(HAS_ITEM, has(de.srendi.advancedperipherals.common.setup.Items.WEAK_AUTOMATA_CORE.get())).save(recipeOutput);
6873

0 commit comments

Comments
 (0)