--- a/net/minecraft/server/gui/MinecraftServerGui.java
+++ b/net/minecraft/server/gui/MinecraftServerGui.java
@@ -12,6 +12,7 @@
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.util.Collection;
+import java.util.Objects;
 import java.util.concurrent.atomic.AtomicBoolean;
 import javax.swing.JComponent;
 import javax.swing.JFrame;
@@ -33,6 +34,7 @@
 import org.slf4j.Logger;
 
 public class MinecraftServerGui extends JComponent {
+
     private static final Font MONOSPACED = new Font("Monospaced", 0, 12);
     private static final Logger LOGGER = LogUtils.getLogger();
     private static final String TITLE = "Minecraft server";
@@ -45,30 +47,41 @@
     public static MinecraftServerGui showFrameFor(final DedicatedServer server) {
         try {
             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Exception var3) {
+        } catch (Exception exception) {
+            ;
         }
 
-        final JFrame jFrame = new JFrame("Minecraft server");
-        final MinecraftServerGui minecraftServerGui = new MinecraftServerGui(server);
-        jFrame.setDefaultCloseOperation(2);
-        jFrame.add(minecraftServerGui);
-        jFrame.pack();
-        jFrame.setLocationRelativeTo((Component)null);
-        jFrame.setVisible(true);
-        jFrame.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowClosing(WindowEvent windowEvent) {
-                if (!minecraftServerGui.isClosing.getAndSet(true)) {
-                    jFrame.setTitle("Minecraft server - shutting down!");
+        final JFrame jframe = new JFrame("Minecraft server");
+        final MinecraftServerGui servergui = new MinecraftServerGui(server);
+
+        jframe.setDefaultCloseOperation(2);
+        jframe.add(servergui);
+        jframe.pack();
+        jframe.setLocationRelativeTo((Component) null);
+        jframe.setVisible(true);
+        jframe.setName("Minecraft server"); // Paper
+
+        // Paper start - Add logo as frame image
+        try {
+            jframe.setIconImage(javax.imageio.ImageIO.read(Objects.requireNonNull(MinecraftServerGui.class.getClassLoader().getResourceAsStream("logo.png"))));
+        } catch (java.io.IOException ignore) {
+        }
+        // Paper end
+
+        jframe.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent windowevent) {
+                if (!servergui.isClosing.getAndSet(true)) {
+                    jframe.setTitle("Minecraft server - shutting down!");
                     server.halt(true);
-                    minecraftServerGui.runFinalizers();
+                    servergui.runFinalizers();
                 }
 
             }
         });
-        minecraftServerGui.addFinalizer(jFrame::dispose);
-        minecraftServerGui.start();
-        return minecraftServerGui;
+        Objects.requireNonNull(jframe);
+        servergui.addFinalizer(jframe::dispose);
+        servergui.start();
+        return servergui;
     }
 
     private MinecraftServerGui(DedicatedServer server) {
@@ -79,8 +92,8 @@
         try {
             this.add(this.buildChatPanel(), "Center");
             this.add(this.buildInfoPanel(), "West");
-        } catch (Exception var3) {
-            LOGGER.error("Couldn't build server GUI", (Throwable)var3);
+        } catch (Exception exception) {
+            MinecraftServerGui.LOGGER.error("Couldn't build server GUI", exception);
         }
 
     }
@@ -90,55 +103,61 @@
     }
 
     private JComponent buildInfoPanel() {
-        JPanel jPanel = new JPanel(new BorderLayout());
-        StatsComponent statsComponent = new StatsComponent(this.server);
-        this.finalizers.add(statsComponent::close);
-        jPanel.add(statsComponent, "North");
-        jPanel.add(this.buildPlayerPanel(), "Center");
-        jPanel.setBorder(new TitledBorder(new EtchedBorder(), "Stats"));
-        return jPanel;
+        JPanel jpanel = new JPanel(new BorderLayout());
+        com.destroystokyo.paper.gui.GuiStatsComponent guistatscomponent = new com.destroystokyo.paper.gui.GuiStatsComponent(this.server); // Paper
+        Collection<Runnable> collection = this.finalizers; // CraftBukkit - decompile error
+
+        Objects.requireNonNull(guistatscomponent);
+        collection.add(guistatscomponent::close);
+        jpanel.add(guistatscomponent, "North");
+        jpanel.add(this.buildPlayerPanel(), "Center");
+        jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Stats"));
+        return jpanel;
     }
 
     private JComponent buildPlayerPanel() {
-        JList<?> jList = new PlayerListComponent(this.server);
-        JScrollPane jScrollPane = new JScrollPane(jList, 22, 30);
-        jScrollPane.setBorder(new TitledBorder(new EtchedBorder(), "Players"));
-        return jScrollPane;
+        JList<?> jlist = new PlayerListComponent(this.server);
+        JScrollPane jscrollpane = new JScrollPane(jlist, 22, 30);
+
+        jscrollpane.setBorder(new TitledBorder(new EtchedBorder(), "Players"));
+        return jscrollpane;
     }
 
     private JComponent buildChatPanel() {
-        JPanel jPanel = new JPanel(new BorderLayout());
-        JTextArea jTextArea = new JTextArea();
-        JScrollPane jScrollPane = new JScrollPane(jTextArea, 22, 30);
-        jTextArea.setEditable(false);
-        jTextArea.setFont(MONOSPACED);
-        JTextField jTextField = new JTextField();
-        jTextField.addActionListener((event) -> {
-            String string = jTextField.getText().trim();
-            if (!string.isEmpty()) {
-                this.server.handleConsoleInput(string, this.server.createCommandSourceStack());
+        JPanel jpanel = new JPanel(new BorderLayout());
+        JTextArea jtextarea = new JTextArea();
+        JScrollPane jscrollpane = new JScrollPane(jtextarea, 22, 30);
+
+        jtextarea.setEditable(false);
+        jtextarea.setFont(MinecraftServerGui.MONOSPACED);
+        JTextField jtextfield = new JTextField();
+
+        jtextfield.addActionListener((actionevent) -> {
+            String s = jtextfield.getText().trim();
+
+            if (!s.isEmpty()) {
+                this.server.handleConsoleInput(s, this.server.createCommandSourceStack());
             }
 
-            jTextField.setText("");
+            jtextfield.setText("");
         });
-        jTextArea.addFocusListener(new FocusAdapter() {
-            @Override
-            public void focusGained(FocusEvent focusEvent) {
-            }
+        jtextarea.addFocusListener(new FocusAdapter() {
+            public void focusGained(FocusEvent focusevent) {}
         });
-        jPanel.add(jScrollPane, "Center");
-        jPanel.add(jTextField, "South");
-        jPanel.setBorder(new TitledBorder(new EtchedBorder(), "Log and chat"));
+        jpanel.add(jscrollpane, "Center");
+        jpanel.add(jtextfield, "South");
+        jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Log and chat"));
         this.logAppenderThread = new Thread(() -> {
-            String string;
-            while((string = LogQueues.getNextLogEvent("ServerGuiConsole")) != null) {
-                this.print(jTextArea, jScrollPane, string);
+            String s;
+
+            while ((s = LogQueues.getNextLogEvent("ServerGuiConsole")) != null) {
+                this.print(jtextarea, jscrollpane, s);
             }
 
         });
-        this.logAppenderThread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER));
+        this.logAppenderThread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(MinecraftServerGui.LOGGER));
         this.logAppenderThread.setDaemon(true);
-        return jPanel;
+        return jpanel;
     }
 
     public void start() {
@@ -156,6 +175,7 @@
         this.finalizers.forEach(Runnable::run);
     }
 
+    private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\e\\[[\\d;]*[^\\d;]"); // CraftBukkit // Paper
     public void print(JTextArea textArea, JScrollPane scrollPane, String message) {
         if (!SwingUtilities.isEventDispatchThread()) {
             SwingUtilities.invokeLater(() -> {
@@ -163,19 +183,21 @@
             });
         } else {
             Document document = textArea.getDocument();
-            JScrollBar jScrollBar = scrollPane.getVerticalScrollBar();
-            boolean bl = false;
+            JScrollBar jscrollbar = scrollPane.getVerticalScrollBar();
+            boolean flag = false;
+
             if (scrollPane.getViewport().getView() == textArea) {
-                bl = (double)jScrollBar.getValue() + jScrollBar.getSize().getHeight() + (double)(MONOSPACED.getSize() * 4) > (double)jScrollBar.getMaximum();
+                flag = (double) jscrollbar.getValue() + jscrollbar.getSize().getHeight() + (double) (MinecraftServerGui.MONOSPACED.getSize() * 4) > (double) jscrollbar.getMaximum();
             }
 
             try {
-                document.insertString(document.getLength(), message, (AttributeSet)null);
-            } catch (BadLocationException var8) {
+                document.insertString(document.getLength(), MinecraftServerGui.ANSI.matcher(message).replaceAll(""), (AttributeSet) null); // CraftBukkit
+            } catch (BadLocationException badlocationexception) {
+                ;
             }
 
-            if (bl) {
-                jScrollBar.setValue(Integer.MAX_VALUE);
+            if (flag) {
+                jscrollbar.setValue(Integer.MAX_VALUE);
             }
 
         }
