fun shuffleInventory(@Nonnull inv: IInventory, @Nonnull random: Random?) { val list: List<ItemStack?> = getInventoryList(inv) Collections.shuffle(list, random) for (i in 0 until inv.getSizeInventory()) { inv.setInventorySlotContents(i, list[i]) } }
Shuffles all items in the inventory