You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.9 KiB
Java
51 lines
1.9 KiB
Java
package net.brokenmoon.afloydironchest.gui;
|
|
|
|
import net.minecraft.src.GuiContainer;
|
|
import net.minecraft.src.IInventory;
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
public class GuiDiamondChest extends GuiContainer {
|
|
private IInventory upperChestInventory;
|
|
private IInventory lowerChestInventory;
|
|
private int inventoryRows;
|
|
|
|
public int xSize = 240;
|
|
public int ySize = 222;
|
|
|
|
public GuiDiamondChest(IInventory iinventory, IInventory iinventory1) {
|
|
super(new ContainerWideChest(iinventory, iinventory1));
|
|
this.upperChestInventory = iinventory;
|
|
this.lowerChestInventory = iinventory1;
|
|
this.field_948_f = false;
|
|
int c = 222;
|
|
int i = c - 108;
|
|
this.inventoryRows = iinventory1.getSizeInventory() / 12;
|
|
this.ySize = i + this.inventoryRows * 18;
|
|
}
|
|
|
|
@Override
|
|
protected void drawGuiContainerForegroundLayer() {
|
|
this.fontRenderer.drawString(this.lowerChestInventory.getInvName(), -24, -47, 0x404040);
|
|
this.fontRenderer.drawString(this.upperChestInventory.getInvName(), 3, 128, 0x404040);
|
|
}
|
|
|
|
@Override
|
|
protected void drawGuiContainerBackgroundLayer(float f) {
|
|
int i = this.mc.renderEngine.getTexture("/assets/ironchest/gui/containerWide.png");
|
|
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
|
this.mc.renderEngine.bindTexture(i);
|
|
int x = (this.width - this.xSize) / 2;
|
|
int y = (this.height - this.ySize) / 2;
|
|
int h1 = Math.min(this.inventoryRows, 6) * 18 + 17;
|
|
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, h1);
|
|
int rows = this.inventoryRows;
|
|
while (rows > 6) {
|
|
int h2 = Math.min(rows, 6) * 18;
|
|
this.drawTexturedModalRect(x, y + h1, 0, 17, this.xSize, h2);
|
|
rows -= 6;
|
|
h1 += h2;
|
|
}
|
|
this.drawTexturedModalRect(x, y + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);
|
|
}
|
|
}
|