From 219b46669b83b8ce576ae0761c55c4a183375589 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Tue, 23 Jul 2024 18:20:59 +0100 Subject: [PATCH] Make CC tweaked compileOnly for now Doesn't work with recent Neoforge --- build.gradle | 2 +- .../datagen/ModRecipeProvider.java | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 16afd5726..236424708 100644 --- a/build.gradle +++ b/build.gradle @@ -169,7 +169,7 @@ dependencies { compileOnly("vazkii.patchouli:Patchouli:${patchouli_version}:api") runtimeOnly("vazkii.patchouli:Patchouli:${patchouli_version}") - implementation("curse.maven:cc-tweaked-282001:${cc_tweaked_curse_id}") + compileOnly("curse.maven:cc-tweaked-282001:${cc_tweaked_curse_id}") // compileOnly("cc.tweaked:cc-tweaked-1.21-forge-api:${cc_tweaked_version}") // runtimeOnly("cc.tweaked:cc-tweaked-1.21-forge:${cc_tweaked_version}") diff --git a/src/main/java/me/desht/pneumaticcraft/datagen/ModRecipeProvider.java b/src/main/java/me/desht/pneumaticcraft/datagen/ModRecipeProvider.java index 655ae91b3..8d0566fe6 100644 --- a/src/main/java/me/desht/pneumaticcraft/datagen/ModRecipeProvider.java +++ b/src/main/java/me/desht/pneumaticcraft/datagen/ModRecipeProvider.java @@ -42,6 +42,7 @@ import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.material.Fluids; +import net.neoforged.fml.ModList; import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.common.conditions.ModLoadedCondition; import net.neoforged.neoforge.common.crafting.DataComponentIngredient; @@ -305,14 +306,16 @@ protected void buildRecipes(RecipeOutput consumer) { 'P', ModItems.PRINTED_CIRCUIT_BOARD.get() ).save(consumer); - Item ccModem = BuiltInRegistries.ITEM.get(ResourceLocation.parse("computercraft:wireless_modem_normal")); - shaped(ModBlocks.DRONE_INTERFACE.get(), ModItems.PRINTED_CIRCUIT_BOARD.get(), - " U /MP /III", - 'I', PneumaticCraftTags.Items.INGOTS_COMPRESSED_IRON, - 'U', ModUpgrades.RANGE.get().getItem(), - 'P', ModItems.PRINTED_CIRCUIT_BOARD.get(), - 'M', ccModem - ).save(consumer.withConditions(new ModLoadedCondition(ModIds.COMPUTERCRAFT)), RL("drone_interface")); + if (ModList.get().isLoaded(ModIds.COMPUTERCRAFT)) { + Item ccModem = BuiltInRegistries.ITEM.get(ResourceLocation.parse("computercraft:wireless_modem_normal")); + shaped(ModBlocks.DRONE_INTERFACE.get(), ModItems.PRINTED_CIRCUIT_BOARD.get(), + " U /MP /III", + 'I', PneumaticCraftTags.Items.INGOTS_COMPRESSED_IRON, + 'U', ModUpgrades.RANGE.get().getItem(), + 'P', ModItems.PRINTED_CIRCUIT_BOARD.get(), + 'M', ccModem + ).save(consumer.withConditions(new ModLoadedCondition(ModIds.COMPUTERCRAFT)), RL("drone_interface")); + } shaped(ModBlocks.ELECTROSTATIC_COMPRESSOR.get(), ModItems.TURBINE_ROTOR.get(), "BPB/PRP/BCB",