GuiDownloadTerrain .java

net.minecraft.client.gui.GuiDownloadTerrain (class, 66 lines): members: netHandlerPlayClient, progress, doesGuiPauseGame, updateScreen, keyTyped, initGui.

net.minecraft.client.guiclass66 linesclientextends GuiScreen1.9 KB

API Surface (5)

void keyTyped(char typedChar, int keyCode)
void initGui()
void updateScreen()
void drawScreen(int mouseX, int mouseY, float partialTicks)
boolean doesGuiPauseGame()

Fields & Constants (2)

netHandlerPlayClient
progress

String literals (1)

"multiplayer.downloadingTerrain"

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

GuiDownloadTerrain.java66 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.gui;
2
3
import java.io.IOException;
4
import net.minecraft.client.network.NetHandlerPlayClient;
5
import net.minecraft.client.resources.I18n;
6
import net.minecraft.network.play.client.C00PacketKeepAlive;
7
8
public class GuiDownloadTerrain extends GuiScreen
9
{
10
    private NetHandlerPlayClient netHandlerPlayClient;
11
    private int progress;
12
13
    public GuiDownloadTerrain(NetHandlerPlayClient netHandler)
14
    {
15
        this.netHandlerPlayClient = netHandler;
16
    }
17
18
    /**
19
     * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
20
     * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
21
     */
22
    protected void keyTyped(char typedChar, int keyCode) throws IOException
23
    {
24
    }
25
26
    /**
27
     * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
28
     * window resizes, the buttonList is cleared beforehand.
29
     */
30
    public void initGui()
31
    {
32
        this.buttonList.clear();
33
    }
34
35
    /**
36
     * Called from the main game loop to update the screen.
37
     */
38
    public void updateScreen()
39
    {
40
        ++this.progress;
41
42
        if (this.progress % 20 == 0)
43
        {
44
            this.netHandlerPlayClient.addToSendQueue(new C00PacketKeepAlive());
45
        }
46
    }
47
48
    /**
49
     * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
50
     */
51
    public void drawScreen(int mouseX, int mouseY, float partialTicks)
52
    {
53
        this.drawBackground(0);
54
        this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215);
55
        super.drawScreen(mouseX, mouseY, partialTicks);
56
    }
57
58
    /**
59
     * Returns true if this GUI should pause the game when it is displayed in single-player
60
     */
61
    public boolean doesGuiPauseGame()
62
    {
63
        return false;
64
    }
65
}
66

Deobfuscated MCP 1.8.9 source of GuiDownloadTerrain from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/gui/GuiDownloadTerrain.java), stored verbatim.