Skip to content

Instantly share code, notes, and snippets.

@fkaa
Created May 6, 2011 07:54
Show Gist options
  • Save fkaa/958584 to your computer and use it in GitHub Desktop.
Save fkaa/958584 to your computer and use it in GitHub Desktop.
package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
import java.util.List;
import java.util.Properties;
import java.io.*;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
public class GuiGameOver extends GuiScreen
{
public Properties getCurrentProperties() {
Properties props = new Properties();
props.setProperty("reviveHealthAmount", Integer.toString(reviveHealthAmount));
return props;
}
public void loadConfig(Properties props) {
String s = props.getProperty("health");
s = props.getProperty("reviveHealthAmount");
reviveHealthAmount = Integer.parseInt(s.trim());
}
public void loadConfig() {
if (!config.exists() || !config.canRead() || !config.isFile()) {
System.out.println(modname+": couldn't load config");
return;
}
Properties props = new Properties();
FileInputStream in = null;
try {
in = new FileInputStream(config);
props.load(in);
} catch (IOException e) {
System.out.println(modname+": couldn't load config");
return;
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {}
}
}
loadConfig(props);
}
public void saveConfig() {
Properties props = getCurrentProperties();
FileOutputStream out = null;
try {
out = new FileOutputStream(config);
props.store(out, "---"+modname+"---");
} catch (IOException e) {
System.out.println(modname+": couldn't save config to "+config);
return;
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {}
}
}
}
public static int reviveHealthAmount = 20;
public GuiGameOver()
{
}
GuiButton reviveControl = null;
public void initGui()
{
controlList.clear();
controlList.add(new GuiButton(1, width / 2 - 100, height / 4 + 72, "Respawn"));
controlList.add(new GuiButton(2, width / 2 - 100, height / 4 + 96, "Title menu"));
reviveControl = new GuiButton(mc.theWorld.multiplayerWorld ? 4 : 3, width / 2 - 100, height / 4 + 122, "Revive");
controlList.add(reviveControl);
if(mc.session == null)
{
((GuiButton)controlList.get(1)).enabled = false;
}
}
protected void keyTyped(char c, int i)
{
}
protected void actionPerformed(GuiButton guibutton)
{
if(guibutton.id != 0);
if(guibutton.id == 1)
{
mc.thePlayer.respawnPlayer();
mc.displayGuiScreen(null);
}
if(guibutton.id == 2)
{
mc.changeWorld1(null);
mc.displayGuiScreen(new GuiMainMenu());
}
if(guibutton.id == 3)
{
mc.thePlayer.isDead = false;
mc.thePlayer.health = reviveHealthAmount;
mc.displayGuiScreen(null);
mc.thePlayer.yOffset=1.62F;
mc.thePlayer.deathTime=0;
mc.thePlayer.posX+=1.5;
}
if(guibutton.id == 4)
{
if (reviveControl != null)
{
reviveControl.displayString="Sorry, you no can has.";
}
}
}
public void drawScreen(int i, int j, float f)
{
drawGradientRect(0, 0, width, height, 0x60500000, 0xa0803030);
GL11.glPushMatrix();
GL11.glScalef(2.0F, 2.0F, 2.0F);
drawCenteredString(fontRenderer, "Game over!", width / 2 / 2, 30, 0xffffff);
GL11.glPopMatrix();
drawCenteredString(fontRenderer, (new StringBuilder()).append("Score: &e").append(mc.thePlayer.getScore()).toString(), width / 2, 100, 0xffffff);
super.drawScreen(i, j, f);
}
public boolean doesGuiPauseGame()
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment