content: package net.minecraft.client.gui;
  
  import net.minecraft.client.resources.I18n;
  import net.minecraft.util.IChatComponent;
  
  import java.io.IOException;
  import java.util.List;
  
  public class GuiDisconnected extends GuiScreen {
      private final String reason;
      private final IChatComponent message;
      private List<String> multilineMessage;
      private final GuiScreen parentScreen;
      private int field_175353_i;
  
      public GuiDisconnected(GuiScreen screen, String reasonLocalizationKey, IChatComponent chatComp) {
          this.parentScreen = screen;
          this.reason = I18n.format(reasonLocalizationKey);
          this.message = chatComp;
      }
  
      protected void keyTyped(char typedChar, int keyCode) throws IOException {
      }
  
      public void initGui() {
          this.buttonList.clear();
          this.multilineMessage = this.fontRendererObj.listFormattedStringToWidth(this.message.getFormattedText(), this.width - 50);
          this.field_175353_i = this.multilineMessage.size() * this.fontRendererObj.FONT_HEIGHT;
          this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 2 + this.field_175353_i / 2 + this.fontRendererObj.FONT_HEIGHT, I18n.format("gui.toMenu")));
      }
  
      protected void actionPerformed(GuiButton button) throws IOException {
          if (button.id == 0) {
              this.mc.displayGuiScreen(this.parentScreen);
          }
      }
  
      public void drawScreen(int mouseX, int mouseY, float partialTicks) {
          this.drawDefaultBackground();
          this.drawCenteredString(this.fontRendererObj, this.reason, this.width / 2, this.height / 2 - this.field_175353_i / 2 - this.fontRendererObj.FONT_HEIGHT * 2, 11184810);
          int i = this.height / 2 - this.field_175353_i / 2;
  
          if (this.multilineMessage != null) {
              for (String s : this.multilineMessage) {
                  this.drawCenteredString(this.fontRendererObj, s, this.width / 2, i, 16777215);
                  i += this.fontRendererObj.FONT_HEIGHT;
              }
          }
  
          super.drawScreen(mouseX, mouseY, partialTicks);
      }
  }
  