Config for unverified username message

This commit is contained in:
Ben Kerllenevich
2025-01-11 19:00:47 -08:00
committed by granny
parent adcdaf66a2
commit 36e0a1504b
3 changed files with 13 additions and 39 deletions

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -307,7 +_,7 @@
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(string1)); // Spigot
} else {
- ServerLoginPacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.unverified_username"));
+ ServerLoginPacketListenerImpl.this.disconnect(org.purpurmc.purpur.PurpurConfig.unverifiedUsername.equals("default") ? Component.translatable("multiplayer.disconnect.unverified_username") : io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.purpurmc.purpur.PurpurConfig.unverifiedUsername))); // Purpur - Config for unverified username message
ServerLoginPacketListenerImpl.LOGGER.error("Username '{}' tried to join with an invalid session", string1);
}
} catch (AuthenticationUnavailableException var4) {

View File

@@ -172,6 +172,7 @@ public class PurpurConfig {
public static String pingCommandOutput = "<green>%s's ping is %sms";
public static String tpsbarCommandOutput = "<green>Tpsbar toggled <onoff> for <target>";
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);
@@ -184,6 +185,7 @@ public class PurpurConfig {
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
tpsbarCommandOutput = getString("settings.messages.tpsbar-command-output", tpsbarCommandOutput);
dontRunWithScissors = getString("settings.messages.dont-run-with-scissors", dontRunWithScissors);
unverifiedUsername = getString("settings.messages.unverified-username", unverifiedUsername);
}
public static String deathMsgRunWithScissors = "<player> slipped and fell on their shears";