resonant-induction/minecraft/liquidmechanics/client/gui/GuiReleaseValve.java
Rseifert 77de6e6353 Making Changes for the better
Starting down the long road of making my mod even more compatable with
other mod's liquids. This will take some time, patience, and pain
killers.

Plan of action
*Release Valve will not store any liquids but rather direction output to
pipes from other TileEntities
*Release Valve will have a gui to restrict it to outputing one or more
types of Liquids that are predefined
*Pipes will go from being fully liquid restricted to color based(0-15)
and have a universal uncolor pipe that can accept all liquids
*Once a pipe is place a tool can be used to change its color just like
in other mods.
*Some colors will be restricted to select liquids for example Blue is
water, Red is Lava, Black is oil, Yellow Fuel, White Milk,
*Steam will have its own pipe made out of bronze to fit the machines it
goes too.
*Tanks will go in the same direction
*Pumps will still be liquid restricted but come with unique textures,
models, and animation per liquid type

Current issues to resolve that are broken with push
*Release valve doesn't work at all due to changes in progress
*back compatable must be added for pipes and old release valves
2013-01-04 19:03:34 -05:00

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(StatCollector.translateToLocal("container.repair"), 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);
}
}