public GridInventoryConverter(Inventory inventory, int length, int offset, Vector2f pos) {
super(inventory, new int[inventory.size()], new Vector2f[inventory.size()], offset);
this.grid = inventory.grid(length);
this.pos = pos;
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));