fixed index out of bounds crash on sorting
however its still filling up the chest with ghost blocks, the fact there there sujests i need to @side.server the function which i think means messing round with packets to execute the function there.
a new branch will be checked out for these changes