Menu

#313 Item transport pipes do not respect IPipeConnection

reports
open
nobody
bug API (1)
2011-10-20
2011-10-20
No

In PipeTransportItems, the pipe detects connections as thus:

public boolean isPipeConnected(TileEntity tile) {
return tile instanceof TileGenericPipe
|| tile instanceof IPipeEntry
|| tile instanceof IInventory
|| (tile instanceof IMachine && ((IMachine) tile).manageSolids());
}

a condition needs to be added for checking if the block there implements IPipeConnection. I'm not sure it'll fit easily in a row vertically like the existing conditions do though. I'd implement this check like so:

int blockId = tile.worldObj.getBlockId(tile.xCoord, tile.yCoord, tile.zCood)
if(Block.blocksList[blockId] != null && Block.blocksList[blockId] instanceof IPipeConnection && ((IPipeConnection)Block.blocksList[blockId]).isPipeConnected(tile.xCoord, tile.yCoord, tile.zCoord, xCoord, yCoord, zCoord) return true;

I think the tile's coords are the first xyz coordinates anyway and the pipe's are second - it'd be nice to have this mentioned in IPipeConnection.java.

Discussion

MongoDB Logo MongoDB