8b1179699f
Model is not fully done since i want to get the valve to set on diffrent faces when the top is in use. Also want it to rotate a bit when powered by redstone. Also worked on connectionHelper and switch a few of the itemRenders to an actual itemRenderHelper so they look nice in the inventory and in the players hand.
103 lines
3.1 KiB
Java
103 lines
3.1 KiB
Java
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);
|
|
this.fontRenderer.drawString("Release Valve", 60, 6, 4210752);
|
|
|
|
|
|
|
|
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);
|
|
}
|
|
|
|
}
|