Merge pull request #2661 from Voxelstice/oc-comp-fix

OC connection with multiblocks bug fix
This commit is contained in:
HbmMods 2026-01-20 10:33:15 +01:00 committed by GitHub
commit 69c1f49f55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,7 @@ import api.hbm.redstoneoverradio.IRORInteractive;
import api.hbm.redstoneoverradio.IRORValueProvider; import api.hbm.redstoneoverradio.IRORValueProvider;
import api.hbm.tile.IHeatSource; import api.hbm.tile.IHeatSource;
import com.hbm.inventory.material.Mats; import com.hbm.inventory.material.Mats;
import com.hbm.util.Compat;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.Optional;
import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Arguments;
@ -512,10 +513,22 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
@Override @Override
@Optional.Method(modid = "OpenComputers") @Optional.Method(modid = "OpenComputers")
public boolean canConnectNode(ForgeDirection side) { public boolean canConnectNode(ForgeDirection side) {
if(this.getCoreObject() instanceof OCComponent) if(this.getCoreObject() instanceof OCComponent) {
boolean isComponent = false;
if (this.worldObj != null) {
Object nodeTE = Compat.getTileStandard(this.worldObj, this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ);
if (nodeTE instanceof TileEntityProxyCombo) {
TileEntityProxyCombo proxy = (TileEntityProxyCombo)nodeTE;
if (proxy.getCoreObject() == this.getCoreObject()) isComponent = true;
} else if (nodeTE == this.getCoreObject()) {
isComponent = true;
}
}
return (this.getBlockMetadata() >= 6 && this.getBlockMetadata() <= 11) return (this.getBlockMetadata() >= 6 && this.getBlockMetadata() <= 11)
&& (power || fluid) && && (power || fluid) &&
((OCComponent) this.getCoreObject()).canConnectNode(side); ((OCComponent) this.getCoreObject()).canConnectNode(side) &&
!isComponent;
}
return OCComponent.super.canConnectNode(null); return OCComponent.super.canConnectNode(null);
} }