mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@4b57bed Updated Upstream (Paper)
49 lines
3.8 KiB
Diff
49 lines
3.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Mon, 24 Jun 2024 14:05:44 +0300
|
|
Subject: [PATCH] Remove vanilla username check
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
|
index 8849862b45ccbbc635a1c316e9870bca81e55c04..85b7c7742a2cc678aec317487fc811b9680e87d6 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
|
@@ -295,7 +295,7 @@ public class CraftPlayerProfile implements PlayerProfile, SharedPlayerProfile {
|
|
|
|
private static GameProfile createAuthLibProfile(UUID uniqueId, String name) {
|
|
Preconditions.checkArgument(name == null || name.length() <= 16, "Name cannot be longer than 16 characters");
|
|
- Preconditions.checkArgument(name == null || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name);
|
|
+ Preconditions.checkArgument(name == null || space.bxteam.divinemc.configuration.DivineConfig.removeVanillaUsernameCheck || StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name); // DivineMC - Remove vanilla username check
|
|
return new GameProfile(
|
|
uniqueId != null ? uniqueId : Util.NIL_UUID,
|
|
name != null ? name : ""
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
index 19d3423644a6a394743c09eb6935bb7633a329a2..de85c108cfc6cfe3357fc381d145851f5bafdf47 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
@@ -174,7 +174,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
|
public void handleHello(ServerboundHelloPacket packet) {
|
|
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
|
|
// Paper start - Validate usernames
|
|
- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
|
+ if (!space.bxteam.divinemc.configuration.DivineConfig.removeVanillaUsernameCheck // DivineMC - Remove vanilla username check
|
|
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
|
&& io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation
|
|
&& !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) {
|
|
Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username", new Object[0]);
|
|
diff --git a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
|
|
index 5d16e0269bbdeb5086dbce9f1d51a4dc45150909..883e3a0c281a4872c74df96e2ce51993f5c4ccee 100644
|
|
--- a/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
|
|
+++ b/src/main/java/space/bxteam/divinemc/configuration/DivineConfig.java
|
|
@@ -154,8 +154,10 @@ public class DivineConfig {
|
|
}
|
|
|
|
public static boolean disableNonEditableSignWarning = true;
|
|
+ public static boolean removeVanillaUsernameCheck = false;
|
|
private static void miscSettings() {
|
|
disableNonEditableSignWarning = getBoolean("settings.misc.disable-non-editable-sign-warning", disableNonEditableSignWarning);
|
|
+ removeVanillaUsernameCheck = getBoolean("settings.misc.remove-vanilla-username-check", removeVanillaUsernameCheck);
|
|
}
|
|
|
|
public static boolean biomeManagerOptimization = true;
|