Files
MinecraftForge/patches/minecraft/net/minecraft/client/gui/GuiSlot.java.patch
T

40 lines
2.4 KiB
Diff

--- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java
@@ -331,16 +331,7 @@
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
Tessellator tessellator = Tessellator.instance;
- this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- float f1 = 32.0F;
- tessellator.startDrawingQuads();
- tessellator.setColorOpaque_I(2105376);
- tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
- tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1));
- tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
- tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1));
- tessellator.draw();
+ drawContainerBackground(tessellator);
j1 = this.width / 2 - 92 - 16;
k1 = this.top + 4 - (int)this.amountScrolled;
@@ -484,4 +475,18 @@
tessellator.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / f));
tessellator.draw();
}
+
+ protected void drawContainerBackground(Tessellator tess)
+ {
+ this.mc.getTextureManager().bindTexture(Gui.optionsBackground);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ float height = 32.0F;
+ tess.startDrawingQuads();
+ tess.setColorOpaque_I(2105376);
+ tess.addVertexWithUV((double)left, (double)bottom, 0.0D, (double)(left / height), (double)((bottom + (int)amountScrolled) / height));
+ tess.addVertexWithUV((double)right, (double)bottom, 0.0D, (double)(right / height), (double)((bottom + (int)amountScrolled) / height));
+ tess.addVertexWithUV((double)right, (double)top, 0.0D, (double)(right / height), (double)((top + (int)amountScrolled) / height));
+ tess.addVertexWithUV((double)left, (double)top, 0.0D, (double)(left / height), (double)((top + (int)amountScrolled) / height));
+ tess.draw();
+ }
}