From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ben Kerllenevich <me@notom3ga.me>
Date: Wed, 19 May 2021 15:33:43 -0400
Subject: [PATCH] Config for unverified username message


diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 9ab220ef0d20151d4e205f3edc213fd9353601ad..2ac8770beec518df79ad3f9324e78b03b72c24d6 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -306,7 +306,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
                         ServerLoginPacketListenerImpl.this.gameProfile = ServerLoginPacketListenerImpl.this.createFakeProfile(gameprofile);
                         ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
                     } else {
-                        ServerLoginPacketListenerImpl.this.disconnect(new TranslatableComponent("multiplayer.disconnect.unverified_username"));
+                        ServerLoginPacketListenerImpl.this.disconnect(net.pl3x.purpur.PurpurConfig.unverifiedUsername.equals("default") ? new TranslatableComponent("multiplayer.disconnect.unverified_username") : PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.get().parse(net.pl3x.purpur.PurpurConfig.unverifiedUsername))); // Purpur
                         ServerLoginPacketListenerImpl.LOGGER.error("Username '{}' tried to join with an invalid session", gameprofile.getName());
                     }
                 } catch (AuthenticationUnavailableException authenticationunavailableexception) {
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 0496d20d982815cc1c56051331ffb51e3d9d0038..b1cb0e5857509921c2f2c112e98ec2801ce5c4c2 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -166,6 +166,7 @@ public class PurpurConfig {
     public static String demoCommandOutput = "<green>%s has been shown the demo screen";
     public static String pingCommandOutput = "<green>%s's ping is %sms";
     public static String dontRunWithScissors = "<red><italic>Don't run with scissors!";
+    public static String unverifiedUsername = "default";
     private static void messages() {
         cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
         afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
@@ -176,6 +177,7 @@ public class PurpurConfig {
         demoCommandOutput = getString("settings.messages.demo-command-output", demoCommandOutput);
         pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
         dontRunWithScissors = getString("settings.messages.dont-run-with-scissors", dontRunWithScissors);
+        unverifiedUsername = getString("settings.messages.unverified-username", unverifiedUsername);
     }
 
     public static boolean advancementOnlyBroadcastToAffectedPlayer = false;
