DisconnectedRealmsScreen .java

net.minecraft.realms.DisconnectedRealmsScreen (class): members: textHeight, buttonClicked, keyPressed, parent, lines, title, reason, init, render.

net.minecraft.realmsclass64 linescommonextends RealmsScreen1.9 KB

API Surface (4)

void init()
void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_)
void buttonClicked(RealmsButton p_buttonClicked_1_)
void render(int p_render_1_, int p_render_2_, float p_render_3_)

Fields & Constants (5)

title
reason
lines
parent
textHeight

String literals (1)

"gui.back"

Code Graph: Dependencies (4)

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

Full Source

DisconnectedRealmsScreen.java64 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.realms;
2
3
import java.util.List;
4
import net.minecraft.util.IChatComponent;
5
6
public class DisconnectedRealmsScreen extends RealmsScreen
7
{
8
    private String title;
9
    private IChatComponent reason;
10
    private List<String> lines;
11
    private final RealmsScreen parent;
12
    private int textHeight;
13
14
    public DisconnectedRealmsScreen(RealmsScreen parentIn, String unlocalizedTitle, IChatComponent reasonIn)
15
    {
16
        this.parent = parentIn;
17
        this.title = getLocalizedString(unlocalizedTitle);
18
        this.reason = reasonIn;
19
    }
20
21
    public void init()
22
    {
23
        Realms.setConnectedToRealms(false);
24
        this.buttonsClear();
25
        this.lines = this.fontSplit(this.reason.getFormattedText(), this.width() - 50);
26
        this.textHeight = this.lines.size() * this.fontLineHeight();
27
        this.buttonsAdd(newButton(0, this.width() / 2 - 100, this.height() / 2 + this.textHeight / 2 + this.fontLineHeight(), getLocalizedString("gui.back")));
28
    }
29
30
    public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_)
31
    {
32
        if (p_keyPressed_2_ == 1)
33
        {
34
            Realms.setScreen(this.parent);
35
        }
36
    }
37
38
    public void buttonClicked(RealmsButton p_buttonClicked_1_)
39
    {
40
        if (p_buttonClicked_1_.id() == 0)
41
        {
42
            Realms.setScreen(this.parent);
43
        }
44
    }
45
46
    public void render(int p_render_1_, int p_render_2_, float p_render_3_)
47
    {
48
        this.renderBackground();
49
        this.drawCenteredString(this.title, this.width() / 2, this.height() / 2 - this.textHeight / 2 - this.fontLineHeight() * 2, 11184810);
50
        int i = this.height() / 2 - this.textHeight / 2;
51
52
        if (this.lines != null)
53
        {
54
            for (String s : this.lines)
55
            {
56
                this.drawCenteredString(s, this.width() / 2, i, 16777215);
57
                i += this.fontLineHeight();
58
            }
59
        }
60
61
        super.render(p_render_1_, p_render_2_, p_render_3_);
62
    }
63
}
64

Deobfuscated MCP 1.8.9 source of DisconnectedRealmsScreen from Marcelektro/MavenMCP-1.8.9 (net/minecraft/realms/DisconnectedRealmsScreen.java), stored verbatim.