diff --git a/build.gradle.kts b/build.gradle.kts index 2be79f8..89c00ae 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -60,6 +60,9 @@ dependencies { implementation(fg.deobf(libs.ae2.get())) implementation(fg.deobf(libs.projecte.get())) + // implementation(fg.deobf(libs.aecapfix.get())) + compileOnly(fg.deobf(libs.aecapfix.get())) + runtimeOnly(fg.deobf(libs.projectex.get())) runtimeOnly(fg.deobf(libs.teampe.get())) runtimeOnly(fg.deobf(libs.jade.get())) diff --git a/settings.gradle.kts b/settings.gradle.kts index 4b71a42..d8c4866 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,6 +20,8 @@ dependencyResolutionManagement { version("projecte", "1.0.1") library("projecte", "curse.maven", "projecte-226410").version("4901949-api-4901951") + library("aecapfix", "curse.maven", "aecapfix-914685").version("5017517") + library("projectex", "curse.maven", "project-expansion-579177").version("5232445") library("teampe", "curse.maven", "team-projecte-689273").version("4882959") library("jade", "curse.maven", "jade-324717").version("5072729") diff --git a/src/main/java/gripe/_90/appliede/AppliedE.java b/src/main/java/gripe/_90/appliede/AppliedE.java index fbc9784..9b5f0be 100644 --- a/src/main/java/gripe/_90/appliede/AppliedE.java +++ b/src/main/java/gripe/_90/appliede/AppliedE.java @@ -12,6 +12,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.loading.FMLEnvironment; @@ -33,6 +34,7 @@ import gripe._90.appliede.iface.EMCInterfaceBlockEntity; import gripe._90.appliede.iface.EMCInterfaceMenu; import gripe._90.appliede.iface.EMCInterfacePart; +import gripe._90.appliede.iface.EMCInterfacePartAECF; import gripe._90.appliede.iface.EMCInterfaceScreen; import gripe._90.appliede.key.EMCKeyType; import gripe._90.appliede.key.EMCRenderer; @@ -64,7 +66,9 @@ public final class AppliedE { ITEMS.register("emc_interface", () -> new BlockItem(block, new Item.Properties())); return block; }); - public static final RegistryObject CABLE_EMC_INTERFACE = ITEMS.register("cable_emc_interface", () -> part(EMCInterfacePart.class, EMCInterfacePart::new)); + public static final RegistryObject CABLE_EMC_INTERFACE = ITEMS.register("cable_emc_interface", () -> ModList.get().isLoaded("aecapfix") + ? part(EMCInterfacePartAECF.class, EMCInterfacePartAECF::new) + : part(EMCInterfacePart.class, EMCInterfacePart::new)); @SuppressWarnings("DataFlowIssue") public static final RegistryObject> EMC_INTERFACE_BE = BE_TYPES.register("emc_interface", () -> { diff --git a/src/main/java/gripe/_90/appliede/iface/EMCInterfacePartAECF.java b/src/main/java/gripe/_90/appliede/iface/EMCInterfacePartAECF.java new file mode 100644 index 0000000..4c90f09 --- /dev/null +++ b/src/main/java/gripe/_90/appliede/iface/EMCInterfacePartAECF.java @@ -0,0 +1,16 @@ +package gripe._90.appliede.iface; + +import appeng.api.parts.IPartItem; + +import gripe._90.aecapfix.AECapFix; + +public class EMCInterfacePartAECF extends EMCInterfacePart implements AECapFix.Invalidator { + public EMCInterfacePartAECF(IPartItem partItem) { + super(partItem); + } + + @Override + public void aecapfix$invalidate() { + getInterfaceLogic().invalidateCaps(); + } +}