GridIterator iter = grid.iterator();
while (iter.hasNext()) {
int i = iter.next(), x = iter.getX(), y = iter.getY(), size = grid.getSize();
slots[i] = (offset + size) - (length * y) - (length - x);
if (VanillaPlugin.getInstance().getEngine() instanceof Client) {
RenderSlot slot = widgets[i].get(RenderSlot.class);
slot.setSlot(new Slot(inventory, i));
slot.setPosition(pos.add(x * SLOT_WIDTH, y * SLOT_HEIGHT));
}
}
}