@Override
public void drawSlot(Slot slotIn) {
int slotSize = 32; // default 16
float glScale = slotSize / 16.0F;
int i = MathHelper.floor_float(slotIn.xDisplayPosition / glScale);
int j = MathHelper.floor_float(slotIn.yDisplayPosition / glScale);
ItemStack itemstack = slotIn.getStack();
boolean flag = false;
boolean flag1 = slotIn == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick;
ItemStack itemstack1 = this.mc.thePlayer.inventory.getItemStack();
String s = null;
if (slotIn == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && itemstack != null)
{
itemstack = itemstack.copy();
itemstack.stackSize /= 2;
}
else if (this.dragSplitting && this.dragSplittingSlots.contains(slotIn) && itemstack1 != null)
{
if (this.dragSplittingSlots.size() == 1)
{
return;
}
if (Container.canAddItemToSlot(slotIn, itemstack1, true) && this.inventorySlots.canDragIntoSlot(slotIn))
{
itemstack = itemstack1.copy();
flag = true;
Container.computeStackSize(this.dragSplittingSlots, this.dragSplittingLimit, itemstack, slotIn.getStack() == null ? 0 : slotIn.getStack().stackSize);
if (itemstack.stackSize > itemstack.getMaxStackSize())
{
s = EnumChatFormatting.YELLOW + "" + itemstack.getMaxStackSize();
itemstack.stackSize = itemstack.getMaxStackSize();
}
if (itemstack.stackSize > slotIn.getItemStackLimit(itemstack))
{
s = EnumChatFormatting.YELLOW + "" + slotIn.getItemStackLimit(itemstack);
itemstack.stackSize = slotIn.getItemStackLimit(itemstack);
}
}
else
{
this.dragSplittingSlots.remove(slotIn);
this.updateDragSplitting();
}
}
this.zLevel = 100.0F;
this.itemRender.zLevel = 100.0F;
GL11.glPushMatrix();
GL11.glScalef(glScale, glScale, 1.0F);
if (itemstack == null)
{
TextureAtlasSprite textureatlassprite = slotIn.getBackgroundSprite();
if (textureatlassprite != null)
{
GlStateManager.disableLighting();
this.mc.getTextureManager().bindTexture(slotIn.getBackgroundLocation());
this.drawTexturedModalRect(i, j, textureatlassprite, slotSize, slotSize);
GlStateManager.enableLighting();
flag1 = true;
}
}
if (!flag1)
{
if (flag)
{
drawRect(i, j, i + slotSize, j + slotSize, -2130706433);
}
GlStateManager.enableDepth();
this.itemRender.renderItemAndEffectIntoGUI(itemstack, i, j);
this.itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, itemstack, i, j, s);
}
GL11.glPopMatrix();
this.itemRender.zLevel = 0.0F;
this.zLevel = 0.0F;
}