package net.minecraft.src;import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
public class GUIThirst extends Gui{
public GUIThirst(){
}
public void Draw(Minecraft mc, int width, int height, int thirst)
{
int var4 = mc.renderEngine.getTexture("/gui/thirst.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(var4);
int var5 = (width - 16) / 2 - 92;
int var6 = (height - 16) / 2 + 64;
float tmp = thirst - 1;
for (int i = 0; i < 10; i++)
{
if ((int)(tmp / 2) >= i)
{
if (tmp / 2 - (int)(tmp / 2) != 0.5 && (int)(tmp / 2) == i)
{
this.drawTexturedModalRect(var5 + (10 - i)* 9, var6, 9, 0, 9, 13);
} else
this.drawTexturedModalRect(var5 + (10 - i) * 9, var6, 0, 0, 9, 13);
} else
this.drawTexturedModalRect(var5 + (10 - i) * 9, var6, 18, 0, 9, 13);
}
this.drawCenteredString(mc.fontRenderer, "DuneCraft Thirst ver 0.0.1",
mc.fontRenderer.getStringWidth("DuneCraft Thirst ver 0.0.1") / 2, 0, 0xffffff);
}
}
package net.minecraft.src;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_Dune extends BaseMod
{
GUIThirst thirstGui = new GUIThirst();
float thirst = 20;
public void load()
{
ModLoader.setInGUIHook(this, true, false);
ModLoader.setInGameHook(this, true, false);
}
public boolean onTickInGui(float f, Minecraft minecraft)
{
return true;
}
public boolean onTickInGame(float f, Minecraft minecraft)
{
if (!minecraft.thePlayer.capabilities.isCreativeMode && minecraft.isGuiEnabled() && !minecraft.isGamePaused)
{
ScaledResolution sr = new ScaledResolution(minecraft.gameSettings, minecraft.displayWidth, minecraft.displayHeight);
int width = sr.getScaledWidth();
int height = sr.getScaledHeight();
thirstGui.Draw(minecraft, width, height, (int)thirst);
}
return true;
}
public String getVersion()
{
return "1.4.2";
}
}
Also a suggestion, perhaps the water should go above the hunger bar. Instead of the armour bar.
--