Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Draws the screen and all the components in it.
- */
- public void drawScreen(int mouseX, int mouseY, float partialTicks)
- {
- int i = this.guiLeft;
- int j = this.guiTop;
- this.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);
- GlStateManager.disableRescaleNormal();
- RenderHelper.disableStandardItemLighting();
- GlStateManager.disableLighting();
- GlStateManager.disableDepth();
- super.drawScreen(mouseX, mouseY, partialTicks);
- RenderHelper.enableGUIStandardItemLighting();
- GlStateManager.pushMatrix();
- GlStateManager.translate((float)i, (float)j, 0.0F);
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- GlStateManager.enableRescaleNormal();
- this.hoveredSlot = null;
- int k = 240;
- int l = 240;
- OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- for (int i1 = 0; i1 < this.inventorySlots.inventorySlots.size(); ++i1)
- {
- Slot slot = this.inventorySlots.inventorySlots.get(i1);
- if (slot.isEnabled())
- {
- this.drawSlot(slot);
- }
- if (this.isMouseOverSlot(slot, mouseX, mouseY) && slot.isEnabled())
- {
- this.hoveredSlot = slot;
- GlStateManager.disableLighting();
- GlStateManager.disableDepth();
- int j1 = slot.xPos;
- int k1 = slot.yPos;
- GlStateManager.colorMask(true, true, true, false);
- this.drawGradientRect(j1, k1, j1 + 16, k1 + 16, -2130706433, -2130706433);
- GlStateManager.colorMask(true, true, true, true);
- GlStateManager.enableLighting();
- GlStateManager.enableDepth();
- }
- }
- RenderHelper.disableStandardItemLighting();
- this.drawGuiContainerForegroundLayer(mouseX, mouseY);
- RenderHelper.enableGUIStandardItemLighting();
- net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiContainerEvent.DrawForeground(this, mouseX, mouseY));
- InventoryPlayer inventoryplayer = this.mc.player.inventory;
- ItemStack itemstack = this.draggedStack.isEmpty() ? inventoryplayer.getItemStack() : this.draggedStack;
- if (!itemstack.isEmpty())
- {
- int j2 = 8;
- int k2 = this.draggedStack.isEmpty() ? 8 : 16;
- String s = null;
- if (!this.draggedStack.isEmpty() && this.isRightMouseClick)
- {
- itemstack = itemstack.copy();
- itemstack.setCount(MathHelper.ceil((float)itemstack.getCount() / 2.0F));
- }
- else if (this.dragSplitting && this.dragSplittingSlots.size() > 1)
- {
- itemstack = itemstack.copy();
- itemstack.setCount(this.dragSplittingRemnant);
- if (itemstack.isEmpty())
- {
- s = "" + TextFormatting.YELLOW + "0";
- }
- }
- this.drawItemStack(itemstack, mouseX - i - 8, mouseY - j - k2, s);
- }
- if (!this.returningStack.isEmpty())
- {
- float f = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F;
- if (f >= 1.0F)
- {
- f = 1.0F;
- this.returningStack = ItemStack.EMPTY;
- }
- int l2 = this.returningStackDestSlot.xPos - this.touchUpX;
- int i3 = this.returningStackDestSlot.yPos - this.touchUpY;
- int l1 = this.touchUpX + (int)((float)l2 * f);
- int i2 = this.touchUpY + (int)((float)i3 * f);
- this.drawItemStack(this.returningStack, l1, i2, (String)null);
- }
- GlStateManager.popMatrix();
- GlStateManager.enableLighting();
- GlStateManager.enableDepth();
- RenderHelper.enableStandardItemLighting();
- }
Advertisement
Add Comment
Please, Sign In to add comment