From 3b7dc10d26cb1ae09b8b47b47766dfdfbb0444e4 Mon Sep 17 00:00:00 2001 From: Yang Xizhi <60341015+GlodBlock@users.noreply.github.com> Date: Sun, 9 Jun 2024 13:07:27 +0800 Subject: [PATCH] Add Upgrade Card support for AE2FC Dual Interfaces (#71) --- .../common/integration/ae2fc/UpgradeInit.java | 15 +++++++++++++++ .../common/registration/definitions/Upgrades.java | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/main/java/co/neeve/nae2/common/integration/ae2fc/UpgradeInit.java diff --git a/src/main/java/co/neeve/nae2/common/integration/ae2fc/UpgradeInit.java b/src/main/java/co/neeve/nae2/common/integration/ae2fc/UpgradeInit.java new file mode 100644 index 0000000..119a634 --- /dev/null +++ b/src/main/java/co/neeve/nae2/common/integration/ae2fc/UpgradeInit.java @@ -0,0 +1,15 @@ +package co.neeve.nae2.common.integration.ae2fc; + +import co.neeve.nae2.common.registration.definitions.Upgrades; +import com.glodblock.github.loader.FCBlocks; +import com.glodblock.github.loader.FCItems; +import net.minecraft.item.ItemStack; + +public class UpgradeInit { + + public static void init(Upgrades.UpgradeType upgrade) { + upgrade.registerItem(new ItemStack(FCBlocks.DUAL_INTERFACE), 1); + upgrade.registerItem(new ItemStack(FCItems.PART_DUAL_INTERFACE), 1); + } + +} diff --git a/src/main/java/co/neeve/nae2/common/registration/definitions/Upgrades.java b/src/main/java/co/neeve/nae2/common/registration/definitions/Upgrades.java index 7beb4b1..6f03257 100644 --- a/src/main/java/co/neeve/nae2/common/registration/definitions/Upgrades.java +++ b/src/main/java/co/neeve/nae2/common/registration/definitions/Upgrades.java @@ -7,11 +7,13 @@ import appeng.core.Api; import appeng.core.features.DamagedItemDefinition; import appeng.core.features.IStackSrc; +import appeng.util.Platform; import co.neeve.nae2.Tags; import co.neeve.nae2.common.crafting.patterntransform.PatternTransform; import co.neeve.nae2.common.crafting.patterntransform.transformers.GregTechCircuitPatternTransformer; import co.neeve.nae2.common.features.IFeature; import co.neeve.nae2.common.features.subfeatures.UpgradeFeatures; +import co.neeve.nae2.common.integration.ae2fc.UpgradeInit; import co.neeve.nae2.common.items.NAEBaseItemUpgrade; import co.neeve.nae2.common.registration.registry.Registry; import co.neeve.nae2.common.registration.registry.interfaces.DamagedDefinitions; @@ -65,6 +67,9 @@ public Upgrades(Registry registry) { UpgradeType.AUTO_COMPLETE.registerItem(blocks.iface(), 1); UpgradeType.AUTO_COMPLETE.registerItem(parts.iface(), 1); + if (Platform.isModLoaded("ae2fc")) { + UpgradeInit.init(UpgradeType.AUTO_COMPLETE); + } }); } @@ -79,6 +84,9 @@ public Upgrades(Registry registry) { UpgradeType.GREGTECH_CIRCUIT.registerItem(blocks.iface(), 1); UpgradeType.GREGTECH_CIRCUIT.registerItem(parts.iface(), 1); + if (Platform.isModLoaded("ae2fc")) { + UpgradeInit.init(UpgradeType.GREGTECH_CIRCUIT); + } }); } }