stack.progress += SPEED;
if(stack.progress > 100)
{
Coord4D prevSet = null;
if(stack.hasPath())
{
int currentIndex = stack.pathToTarget.indexOf(Coord4D.get(tile()));
Coord4D next = stack.pathToTarget.get(currentIndex-1);
if(!stack.isFinal(this))
{
if(next != null && stack.canInsertToTransporter(stack.getNext(this).getTileEntity(world()), ForgeDirection.getOrientation(stack.getSide(this))))
{
ILogisticalTransporter nextTile = (ILogisticalTransporter)next.getTileEntity(world());
nextTile.entityEntering(stack);
remove.add(stack);
continue;
}
else if(next != null)
{
prevSet = next;
}
}
else {
if(stack.pathType != Path.NONE)
{
if(next != null && next.getTileEntity(world()) instanceof IInventory)
{
needsSync.add(stack);
IInventory inventory = (IInventory)next.getTileEntity(world());
if(inventory != null)
{
ItemStack rejected = InventoryUtils.putStackInInventory(inventory, stack.itemStack, stack.getSide(this), stack.pathType == Path.HOME);