From f88155ef0e89693a1a799dc667ea82d71485f196 Mon Sep 17 00:00:00 2001 From: ganymedes01 Date: Fri, 23 Aug 2013 13:43:18 +0100 Subject: [PATCH] Better handling for ISidedInventory tile entities The pipe shouldn't connect to an inventory that isn't available from a certain side. With this it would be easier to manage what sides the pipe connects to without having to implement IPipeConnection. And also get rid of unnecessary connections. --- common/buildcraft/transport/PipeTransportItems.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/buildcraft/transport/PipeTransportItems.java b/common/buildcraft/transport/PipeTransportItems.java index 5fe69429..4a7d611a 100644 --- a/common/buildcraft/transport/PipeTransportItems.java +++ b/common/buildcraft/transport/PipeTransportItems.java @@ -572,7 +572,9 @@ public class PipeTransportItems extends PipeTransport { if (BlockGenericPipe.isValid(pipe2) && !(pipe2.transport instanceof PipeTransportItems)) return false; } - + + if(tile instanceof ISidedInventory) + return ((ISidedInventory)tile).getAccessibleSlotsFromSide(side.getOpposite().ordinal()).length > 0; return tile instanceof TileGenericPipe || tile instanceof ISpecialInventory || (tile instanceof IInventory && ((IInventory) tile).getSizeInventory() > 0) || (tile instanceof IMachine && ((IMachine) tile).manageSolids()); }