I get an error saying that my bound must be positive. Here is the line I get it on:
inv.setItem(i, items.get(r.nextInt(items.size())));
As
As far as your stacktrace says,
java.lang.IllegalArgumentException: bound must be positive at java.util.Random.nextInt(Unknown Source) ~[?:1.8.0_51]
The argument to nextInt needs to be a positive integer. You will need to find out where you're passing a non-positive input to that method.
The issue is that you are calling Random.nextInt() with a zero and it doesn't like that. That is happening because the List from getAllItems() is empty. I would prevent this situation by checking that the list has items before performing your logic:
List<ItemStack> items = getAllItems(level);
if(!items.isEmpty()) {
inv.setItem(i, items.get(r.nextInt(items.size())));
}