I tried to paste in the code but for some reason even using the code bbcode it wasn't indenting correctly and was really hard to read, so check it out in the above link. We also tried to do some debugging so you can see where we are at.
Seems to logically be something in the Container code, probably within those for loops in the constructor.
I have no idea if what you're doing is right or wrong but assuming it is, all I can suggest is to put a crap load of System.out.print* lines inside the for loops (but before the actual calls) to print the parameters before making the call, then you can search your crash log for the numbers - that should at least give you an idea of when/where it happens which will help to solve why.
45 is a multiple of 9, and I see that the second addSlotToContainer nested for loop uses * 9 in it's call so I'd try that one first. But it could be anywhere, that logic is confusing the heck out of me
EDIT: I mean this line:
this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
I have no idea what's going on there (you did consider the order of operations right? How * and / happen before + and -) but just before this line is the first place I'd print to console from:
System.out.printf("%d %d %d", j + i * 9 + 9, 8 + j * 18, 84 + i * 18)