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.
()
| 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 | } |
nothing calls this directly
no test coverage detected