MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / initGui

Method initGui

src/main/java/net/minecraft/client/gui/GuiWinGame.java:88–145  ·  view source on GitHub ↗

Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the window resizes, the buttonList is cleared beforehand.

()

Source from the content-addressed store, hash-verified

86 * window resizes, the buttonList is cleared beforehand.
87 */
88 public void initGui()
89 {
90 if (this.field_146582_i == null)
91 {
92 this.field_146582_i = Lists.<String>newArrayList();
93
94 try
95 {
96 String s = "";
97 String s1 = "" + ChatFormatting.WHITE + ChatFormatting.OBFUSCATED + ChatFormatting.GREEN + ChatFormatting.AQUA;
98 int i = 274;
99 InputStream inputstream = this.mc.getResourceManager().getResource(new ResourceLocation("texts/end.txt")).getInputStream();
100 BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream, Charsets.UTF_8));
101 Random random = new Random(8124371L);
102
103 while ((s = bufferedreader.readLine()) != null)
104 {
105 String s2;
106 String s3;
107
108 for (s = s.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); s.contains(s1); s = s2 + ChatFormatting.WHITE + ChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, random.nextInt(4) + 3) + s3)
109 {
110 int j = s.indexOf(s1);
111 s2 = s.substring(0, j);
112 s3 = s.substring(j + s1.length());
113 }
114
115 this.field_146582_i.addAll(this.mc.MCfontRenderer.listFormattedStringToWidth(s, i));
116 this.field_146582_i.add("");
117 }
118
119 inputstream.close();
120
121 for (int k = 0; k < 8; ++k)
122 {
123 this.field_146582_i.add("");
124 }
125
126 inputstream = this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream();
127 bufferedreader = new BufferedReader(new InputStreamReader(inputstream, Charsets.UTF_8));
128
129 while ((s = bufferedreader.readLine()) != null)
130 {
131 s = s.replaceAll("PLAYERNAME", this.mc.getSession().getUsername());
132 s = s.replaceAll("\t", " ");
133 this.field_146582_i.addAll(this.mc.MCfontRenderer.listFormattedStringToWidth(s, i));
134 this.field_146582_i.add("");
135 }
136
137 inputstream.close();
138 this.field_146579_r = this.field_146582_i.size() * 12;
139 }
140 catch (Exception exception)
141 {
142 logger.error("Couldn\'t load credits", exception);
143 }
144 }
145 }

Callers

nothing calls this directly

Calls 15

readLineMethod · 0.80
nextIntMethod · 0.80
lengthMethod · 0.80
addAllMethod · 0.80
getInputStreamMethod · 0.65
getResourceMethod · 0.65
closeMethod · 0.65
getResourceManagerMethod · 0.45
getUsernameMethod · 0.45
getSessionMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected