drawRect(guiLeft + 6, guiTop + 16, right - 12, bottom - 84, BasicGuiHelper.ConvertEnumToColor(Colors.MiddleGrey));
drawRect(guiLeft + 6, bottom - 52, right - 12, bottom - 32, BasicGuiHelper.ConvertEnumToColor(Colors.DarkGrey));
for(ItemIdentifierStack itemStack : diskProvider.getItemDisplay()._allItems) {
ItemIdentifier item = itemStack.getItem();
if(!itemSearched(item)) continue;
ppi++;
if (ppi <= 45 * pageAll) continue;
if (ppi > 45 * (pageAll+1)) continue;
ItemStack st = itemStack.unsafeMakeNormalStack();
int x = guiLeft + 10 + panelxSize * column;
int y = guiTop + 18 + panelySize * row;
GL11.glDisable(2896 /*GL_LIGHTING*/);
if(!super.hasSubGui()) {
if (mouseX >= x && mouseX < x + panelxSize && mouseY >= y && mouseY < y + panelySize) {
drawRect(x - 3, y - 1, x + panelxSize - 3, y + panelySize - 3, BasicGuiHelper.ConvertEnumToColor(Colors.Black));
drawRect(x - 2, y - 0, x + panelxSize - 4, y + panelySize - 4, BasicGuiHelper.ConvertEnumToColor(Colors.DarkGrey));
tooltip = new Object[]{mouseX + guiLeft,mouseY + guiTop,st, false};
}
if(mousePosX != 0 && mousePosY != 0) {
if ((mousePosX >= x && mousePosX < x + panelxSize && mousePosY >= y && mousePosY < y + panelySize) || (mouseX >= x && mouseX < x + panelxSize && mouseY >= y && mouseY < y + panelySize && (wheeldown != 0 || wheelup != 0))) {
boolean handled = false;
for(ItemIdentifierStack stack:macroItems) {
if(stack.getItem().equals(item)) {
if(mousebutton == 0 || wheelup != 0) {
stack.setStackSize(stack.getStackSize() + (1 + (wheelup != 0 ? wheelup - 1: 0)));
} else if(mousebutton == 1 || wheeldown != 0) {
stack.setStackSize(stack.getStackSize() - (1 + (wheeldown != 0 ? wheeldown - 1: 0)));
if(stack.getStackSize() <= 0) {
macroItems.remove(stack);
}
}
handled = true;
break;
}
}
if(!handled) {
int i = 0;
for(ItemIdentifierStack stack:macroItems) {
if(item == stack.getItem() && item.itemDamage < stack.getItem().itemDamage) {
if(mousebutton == 0 || wheelup != 0) {
macroItems.add(i, item.makeStack(1 + (wheelup != 0 ? wheelup - 1: 0)));
} else if(mousebutton == 2) {
macroItems.add(i, item.makeStack(64));
}
handled = true;
break;
}
if(Item.getIdFromItem(item.item) < Item.getIdFromItem(stack.getItem().item)) {
if(mousebutton == 0 || wheelup != 0) {
macroItems.add(i, item.makeStack(1 + (wheelup != 0 ? wheelup - 1: 0)));
} else if(mousebutton == 2) {
macroItems.add(i, item.makeStack(64));
}
handled = true;
break;
}
i++;
}
if(!handled) {
if(mousebutton == 0 || wheelup != 0) {
macroItems.addLast(item.makeStack(1 + (wheelup != 0 ? wheelup - 1: 0)));
} else if(mousebutton == 2) {
macroItems.addLast(item.makeStack(64));
}
}
}
mousePosX = 0;
mousePosY = 0;
}
}
}
column++;
if (column == 9){
row++;
column = 0;
}
}
BasicGuiHelper.renderItemIdentifierStackListIntoGui(diskProvider.getItemDisplay()._allItems, this, pageAll, guiLeft + 10, guiTop + 18, 9, 45, panelxSize, panelySize, mc, false, false);
ppi = 0;
column = 0;
row = 0;
for(ItemIdentifierStack itemStack : macroItems) {
ItemIdentifier item = itemStack.getItem();
if(!itemSearched(item)) continue;
ppi++;
if (ppi <= 9 * pageMacro) continue;
if (ppi > 9 * (pageMacro+1)) continue;