From 135ac414a7c2273b52093eac0ab852372a18000d Mon Sep 17 00:00:00 2001 From: Zuxelus Date: Mon, 27 May 2024 20:03:52 +0300 Subject: [PATCH] 1.7.10-0.3.5e HBM Energy API fix --- build.gradle | 4 ++-- .../zuxelus/energycontrol/crossmod/CrossModLoader.java | 2 +- .../tileentities/TileEntityKitAssembler.java | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index f5d9d17c..735ac5cc 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-0.3.5d" +version = "1.7.10-0.3.5e" group= "com.zuxelus.energycontrol" archivesBaseName = "EnergyControl" @@ -47,7 +47,7 @@ dependencies { 'libs_/gregtech_1.7.10-6.17.01.jar', 'libs_/GalacticraftCore-1.7-3.0.12.504.jar', 'libs_/Galacticraft-Planets-1.7-3.0.12.504.jar', - 'libs_/HBM-NTM-.1.0.27_X4880.jar', + 'libs_/HBM-NTM-.1.0.27_X4977.jar', 'libs_/industrialcraft-2-2.2.827-experimental-dev.jar', 'libs_/Mekanism-1.7.10-9.1.1.1031.jar', 'libs_/NotEnoughItems-1.7.10-1.0.5.120-universal.jar', diff --git a/src/main/java/com/zuxelus/energycontrol/crossmod/CrossModLoader.java b/src/main/java/com/zuxelus/energycontrol/crossmod/CrossModLoader.java index 44050487..8f952077 100644 --- a/src/main/java/com/zuxelus/energycontrol/crossmod/CrossModLoader.java +++ b/src/main/java/com/zuxelus/energycontrol/crossmod/CrossModLoader.java @@ -53,7 +53,7 @@ public static void preInit() { Matcher matcher = Pattern.compile("\\d\\d\\d\\d").matcher(container.getVersion()); if (matcher.find()) { int version = Integer.parseInt(container.getVersion().substring(matcher.start(), matcher.end())); - if (version >= 4880) + if (version >= 4977) loadCrossModSafely(ModIDs.HBM, () -> CrossHBM::new); } } diff --git a/src/main/java/com/zuxelus/energycontrol/tileentities/TileEntityKitAssembler.java b/src/main/java/com/zuxelus/energycontrol/tileentities/TileEntityKitAssembler.java index fc5caf4e..5161f099 100644 --- a/src/main/java/com/zuxelus/energycontrol/tileentities/TileEntityKitAssembler.java +++ b/src/main/java/com/zuxelus/energycontrol/tileentities/TileEntityKitAssembler.java @@ -13,7 +13,7 @@ import com.zuxelus.zlib.tileentities.ITilePacketHandler; import com.zuxelus.zlib.tileentities.TileEntityInventory; -import api.hbm.energy.IEnergyUser; +import api.hbm.energymk2.IEnergyReceiverMK2; import cofh.api.energy.IEnergyReceiver; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Optional; @@ -32,10 +32,10 @@ @Optional.InterfaceList({ @Optional.Interface(modid = ModIDs.IC2, iface = "ic2.api.energy.tile.IEnergySink"), - @Optional.Interface(modid = ModIDs.HBM, iface = "api.hbm.energy.IEnergyUser"), + @Optional.Interface(modid = ModIDs.HBM, iface = "api.hbm.energymk2.IEnergyReceiverMK2"), @Optional.Interface(modid = ModIDs.THERMAL_EXPANSION, iface = "cofh.redstoneflux.api.IEnergyReceiver"), }) -public class TileEntityKitAssembler extends TileEntityInventory implements ITilePacketHandler, ISlotItemFilter, IEnergySink, IEnergyUser, IEnergyReceiver { +public class TileEntityKitAssembler extends TileEntityInventory implements ITilePacketHandler, ISlotItemFilter, IEnergySink, IEnergyReceiverMK2, IEnergyReceiver { public static final byte SLOT_INFO = 0; public static final byte SLOT_CARD1 = 1; public static final byte SLOT_ITEM = 2; @@ -201,7 +201,8 @@ public void updateEntity() { return; handleDischarger(SLOT_DISCHARGER); if (Loader.isModLoaded(ModIDs.HBM)) - updateStandardConnections(worldObj, xCoord, yCoord, zCoord); + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) + trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir); if (!active) return; if (storage.getEnergyStored() >= CONSUMPTION) {