package net.minecraft.client.gui;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.resources.I18n;
import net.minecraft.network.play.client.C00PacketKeepAlive;
@SideOnly(Side.CLIENT)
public class GuiDownloadTerrain extends GuiScreen
{
private NetHandlerPlayClient netHandlerPlayClient;
private int progress;
private static final String __OBFID = "CL_00000708";
public GuiDownloadTerrain(NetHandlerPlayClient p_i45023_1_)
{
this.netHandlerPlayClient = p_i45023_1_;
}
/**
* Fired when a key is typed (except F11 who toggle full screen). This is the equivalent of
* KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
*/
protected void keyTyped(char typedChar, int keyCode) {}
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui()
{
this.buttonList.clear();
}
/**
* Called from the main game loop to update the screen.
*/
public void updateScreen()
{
++this.progress;
if (this.progress % 20 == 0)
{
this.netHandlerPlayClient.addToSendQueue(new C00PacketKeepAlive());
}
if (this.netHandlerPlayClient != null)
{
this.netHandlerPlayClient.onNetworkTick();
}
}
/**
* Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
*/
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
this.drawBackground(0);
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215);
super.drawScreen(mouseX, mouseY, partialTicks);
}
/**
* Returns true if this GUI should pause the game when it is displayed in single-player
*/
public boolean doesGuiPauseGame()
{
return false;
}
}