Skip to content

Instantly share code, notes, and snippets.

@Flow86
Created October 13, 2011 18:09
Show Gist options
  • Save Flow86/1284978 to your computer and use it in GitHub Desktop.
Save Flow86/1284978 to your computer and use it in GitHub Desktop.
the lookup patch
diff --git a/buildcraft/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java b/buildcraft/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java
index 966b2bb..5e5c1fe 100755
--- a/buildcraft/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java
+++ b/buildcraft/common/net/minecraft/src/buildcraft/transport/BlockGenericPipe.java
@@ -226,7 +226,7 @@ public class BlockGenericPipe extends BlockContainer implements
{
continue;
}
- int k1 = getPipe(world, i, j, k).itemID;
+ int k1 = getPipe(world, i, j, k, true).itemID;
if(k1 > 0)
{
dropBlockAsItem_do(world, i, j, k, new ItemStack(k1, 1, damageDropped(l)));
@@ -365,19 +365,19 @@ public class BlockGenericPipe extends BlockContainer implements
}
public static Pipe getPipe (IBlockAccess blockAccess, int i, int j, int k) {
+ return getPipe(blockAccess, i, j, k, false);
+ }
+
+ public static Pipe getPipe (IBlockAccess blockAccess, int i, int j, int k, boolean lookup) {
TileEntity tile = blockAccess.getBlockTileEntity(i, j, k);
- Pipe pipe = null;
-
- if (tile instanceof TileGenericPipe) {
- pipe = ((TileGenericPipe) tile).pipe;
- }
+ if (tile instanceof TileGenericPipe)
+ return ((TileGenericPipe) tile).pipe;
- if (pipe == null) {
- pipe = pipeBuffer.get(new BlockIndex(i, j, k));
- }
+ if(lookup)
+ return pipeBuffer.get(new BlockIndex(i, j, k));
- return pipe;
+ return null;
}
public static boolean isValid (Pipe pipe) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment