Created
October 2, 2011 07:54
-
-
Save Flow86/1257214 to your computer and use it in GitHub Desktop.
this patch reverses the item if we have a pipe-connection but blocked exit, and fixes the "every output blocked"-bug of the iron pipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java | |
index d654489..dcd5345 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeLogicIron.java | |
@@ -112,8 +112,13 @@ public class PipeLogicIron extends PipeLogic { | |
@Override | |
public boolean outputOpen(Orientations to) { | |
- return to.ordinal() == worldObj | |
- .getBlockMetadata(xCoord, yCoord, zCoord); | |
+ int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); | |
+ if (metadata > 5) { | |
+ metadata = 0; | |
+ worldObj.setBlockMetadata(xCoord, yCoord, zCoord, metadata); | |
+ } | |
+ | |
+ return to.ordinal() == metadata; | |
} | |
} | |
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java | |
index bb398ec..08f7c17 100755 | |
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java | |
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/PipeTransportItems.java | |
@@ -121,6 +121,22 @@ public class PipeTransportItems extends PipeTransport { | |
} | |
} | |
+ if(result.size() == 0) { | |
+ boolean output = true; | |
+ for (int o = 0; o < 6; ++o) { | |
+ Position newPos = new Position(pos); | |
+ newPos.orientation = Orientations.values()[o]; | |
+ newPos.moveForwards(1.0); | |
+ TileEntity tile = worldObj.getBlockTileEntity((int)newPos.x, (int)newPos.y, (int)newPos.z); | |
+ | |
+ if(container.pipe.isPipeConnected(tile) && !container.pipe.outputOpen(Orientations.values()[o])) | |
+ output = false; | |
+ } | |
+ // we have a pipe, but no open output | |
+ if(!output) | |
+ result.add(pos.orientation.reverse()); | |
+ } | |
+ | |
if (this.container.pipe instanceof IPipeTransportItemsHook) { | |
result = ((IPipeTransportItemsHook) this.container.pipe) | |
.filterPossibleMovements(result, pos, item); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment