2013-01-05 01:03:20 +01:00
|
|
|
package liquidmechanics.client.gui;
|
|
|
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
import java.util.List;
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
import net.minecraft.inventory.Container;
|
|
|
|
import net.minecraft.inventory.ContainerRepair;
|
|
|
|
import net.minecraft.inventory.ICrafting;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.network.packet.Packet250CustomPayload;
|
|
|
|
import net.minecraft.util.StatCollector;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import org.lwjgl.input.Keyboard;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public class GuiReleaseValve extends GuiContainer
|
|
|
|
{
|
|
|
|
private ContainerRepair field_82327_o;
|
|
|
|
private InventoryPlayer field_82325_q;
|
|
|
|
|
|
|
|
public GuiReleaseValve(InventoryPlayer par1, World par2World, int par3, int par4, int par5)
|
|
|
|
{
|
|
|
|
super(new ContainerRepair(par1, par2World, par3, par4, par5, Minecraft.getMinecraft().thePlayer));
|
|
|
|
this.field_82325_q = par1;
|
|
|
|
this.field_82327_o = (ContainerRepair)this.inventorySlots;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds the buttons (and other controls) to the screen in question.
|
|
|
|
*/
|
|
|
|
public void initGui()
|
|
|
|
{
|
|
|
|
super.initGui();
|
|
|
|
Keyboard.enableRepeatEvents(true);
|
|
|
|
int width = (this.width - this.xSize) / 2;
|
|
|
|
int height = (this.height - this.ySize) / 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when the screen is unloaded. Used to disable keyboard repeat events
|
|
|
|
*/
|
|
|
|
public void onGuiClosed()
|
|
|
|
{
|
|
|
|
super.onGuiClosed();
|
|
|
|
Keyboard.enableRepeatEvents(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw the foreground layer for the GuiContainer (everything in front of the items)
|
|
|
|
*/
|
|
|
|
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
|
|
|
{
|
|
|
|
GL11.glDisable(GL11.GL_LIGHTING);
|
2013-01-07 21:19:00 +01:00
|
|
|
this.fontRenderer.drawString("Release Valve", 60, 6, 4210752);
|
2013-01-05 01:03:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GL11.glEnable(GL11.GL_LIGHTING);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
|
|
|
|
*/
|
|
|
|
protected void keyTyped(char par1, int par2)
|
|
|
|
{
|
|
|
|
super.keyTyped(par1, par2);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when the mouse is clicked.
|
|
|
|
*/
|
|
|
|
protected void mouseClicked(int par1, int par2, int par3)
|
|
|
|
{
|
|
|
|
super.mouseClicked(par1, par2, par3);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draws the screen and all the components in it.
|
|
|
|
*/
|
|
|
|
public void drawScreen(int par1, int par2, float par3)
|
|
|
|
{
|
|
|
|
super.drawScreen(par1, par2, par3);
|
|
|
|
GL11.glDisable(GL11.GL_LIGHTING);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw the background layer for the GuiContainer (everything behind the items)
|
|
|
|
*/
|
|
|
|
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
|
|
|
{
|
|
|
|
int tID = this.mc.renderEngine.getTexture("/gui/repair.png");
|
|
|
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
|
|
|
this.mc.renderEngine.bindTexture(tID);
|
|
|
|
int width = (this.width - this.xSize) / 2;
|
|
|
|
int height = (this.height - this.ySize) / 2;
|
|
|
|
this.drawTexturedModalRect(width, height, 0, 0, this.xSize, this.ySize);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|