// From main inventory/quickbar to the dispenser
if (from instanceof PlayerMainInventory || from instanceof QuickbarInventory) {
for (InventoryConverter conv : this.getInventoryConverters()) {
Inventory inv = conv.getInventory();
if (inv instanceof DispenserInventory) {
Grid grid = inv.grid(3);
final int height = grid.getHeight();
final int length = grid.getLength();
for (int row = height - 1; row >= 0; row--) {
int startSlot = length * row;
int endSlot = startSlot + length - 1;
inv.add(startSlot, endSlot, stack);
from.set(slot, stack);