From a0559b723c31a4f4f8763ca9781a7ff1bf5b4bcd Mon Sep 17 00:00:00 2001 From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> Date: Sun, 21 Jul 2024 02:45:16 +0300 Subject: [PATCH] Updated Upstream (Purpur) Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@032697e Updated Upstream (Paper) PurpurMC/Purpur@b2d1fea always output bukkit/paper plugin header in plugin command --- gradle.properties | 2 +- patches/api/0005-Delete-Timings.patch | 18 +- .../0047-NoChatReports-Implementation.patch | 173 ------------------ 3 files changed, 7 insertions(+), 186 deletions(-) delete mode 100644 patches/removed/1.19.3/server/0047-NoChatReports-Implementation.patch diff --git a/gradle.properties b/gradle.properties index 9fcd078..2def731 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group = space.bxteam.divinemc mcVersion = 1.21 version = 1.21-R0.1-SNAPSHOT -purpurRef = 936c29ae2ab768b8b1cf3f69e9b3e89c2a4b3f14 +purpurRef = 032697e7ac8946c54d7a3399c385951ff06b3e6e org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/api/0005-Delete-Timings.patch b/patches/api/0005-Delete-Timings.patch index d47eca4..d03282a 100644 --- a/patches/api/0005-Delete-Timings.patch +++ b/patches/api/0005-Delete-Timings.patch @@ -1271,10 +1271,10 @@ index df142a89b8c43acb81eb383eac0ef048a1f49a6e..00000000000000000000000000000000 -} diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java deleted file mode 100644 -index 752d54830aa8baa1450bf72da03ae55ed30293c2..0000000000000000000000000000000000000000 +index 7e730a5c6f9bd23befe030a897884b7d0c653859..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/Timings.java +++ /dev/null -@@ -1,339 +0,0 @@ +@@ -1,333 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -1438,23 +1438,17 @@ index 752d54830aa8baa1450bf72da03ae55ed30293c2..00000000000000000000000000000000 - - public static Component deprecationMessage() { - return Component.text() -- .color(TextColor.color(0xf3ef91)) +- .color(TextColor.color(0xffc93a)) - .append(Component.text("[!] The timings profiler has been enabled but has been scheduled for removal from Paper in the future.")) - .append(Component.newline()) -- .append( -- Component.text(" We recommend installing the spark profiler as a replacement: ") -- .append( -- Component.text() -- .content("https://spark.lucko.me/") -- .clickEvent(ClickEvent.openUrl("https://spark.lucko.me/"))) -- ) +- .append(Component.text(" We recommend migrating to the spark profiler.")) - .append(Component.newline()) - .append( - Component.text(" For more information please visit: ") - .append( - Component.text() -- .content("https://github.com/PaperMC/Paper/issues/8948") -- .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/issues/8948"))) +- .content("https://github.com/PaperMC/Paper/discussions/10565") +- .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/discussions/10565"))) - ) - .build(); - } diff --git a/patches/removed/1.19.3/server/0047-NoChatReports-Implementation.patch b/patches/removed/1.19.3/server/0047-NoChatReports-Implementation.patch deleted file mode 100644 index d50326c..0000000 --- a/patches/removed/1.19.3/server/0047-NoChatReports-Implementation.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com> -Date: Sun, 19 Mar 2023 19:07:20 +0300 -Subject: [PATCH] NoChatReports Implementation - -idk why, but server status has been updated. waiting for ncr - -diff --git a/src/main/java/gq/bxteam/divinemc/DivineConfig.java b/src/main/java/gq/bxteam/divinemc/DivineConfig.java ---- a/src/main/java/gq/bxteam/divinemc/DivineConfig.java (revision 5273f89dd19146a784cf4c584647befb8099b105) -+++ b/src/main/java/gq/bxteam/divinemc/DivineConfig.java (date 1679415878866) -@@ -131,4 +131,14 @@ - return config.getStringList(key); - } - -+ public static boolean noChatReportsEnable = true; -+ public static boolean noChatReportsConvertToGameMessage = true; -+ public static boolean noChatReportsAddQueryData = true; -+ -+ private static void noChatReportsConfig() { -+ setComment("no-chat-reports", "[ No Chat Reports ] Player Chat Reporting Control Mod"); -+ noChatReportsEnable = getBoolean("no-chat-reports.enable", noChatReportsEnable); -+ noChatReportsConvertToGameMessage = getBoolean("no-chat-reports.convert-to-game-message", noChatReportsConvertToGameMessage) && noChatReportsEnable; -+ noChatReportsAddQueryData = getBoolean("no-chat-reports.add-query-data", noChatReportsAddQueryData) && noChatReportsEnable; -+ } - } -\ No newline at end of file -diff --git a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java -index 6e0a3086da142f1c42007a16bbec7edbab17da04..60ad75fdf0c43a19cdfaf73fd07ad0a8b4d0da96 100644 ---- a/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java -+++ b/src/main/java/net/minecraft/network/protocol/status/ServerStatus.java -@@ -28,6 +28,14 @@ public class ServerStatus { - private String favicon; - private boolean enforcesSecureChat; - -+ // DivineMC start - NoChatReports -+ /** -+ * Special additional variable that allows the client to know whether server prevents chat reports -+ * upon pinging it. -+ */ -+ private boolean preventsChatReports; -+ // DivineMC end -+ - @Nullable - public Component getDescription() { - return this.description; -@@ -68,9 +76,23 @@ public class ServerStatus { - this.enforcesSecureChat = secureChatEnforced; - } - -+ // DivineMC start - NoChatReports - public boolean enforcesSecureChat() { -- return this.enforcesSecureChat; -+ return gq.bxteam.divinemc.DivineConfig.noChatReportsConvertToGameMessage ? true : this.enforcesSecureChat; -+ } -+ -+ public boolean preventsChatReports() { -+ if (this.getVersion() != null && this.getVersion().getProtocol() < 759 -+ && this.getVersion().getProtocol() > 0) -+ return true; -+ -+ return this.preventsChatReports; -+ } -+ -+ public void setPreventsChatReports(boolean prevents) { -+ this.preventsChatReports = prevents; - } -+ // DivineMC end - - public static class Players { - private final int maxPlayers; -@@ -173,6 +195,12 @@ public class ServerStatus { - serverStatus.setEnforcesSecureChat(GsonHelper.getAsBoolean(jsonObject, "enforcesSecureChat")); - } - -+ // DivineMC start - NoChatReports -+ if (jsonObject.has("preventsChatReports")) { -+ serverStatus.setPreventsChatReports(GsonHelper.getAsBoolean(jsonObject, "preventsChatReports")); -+ } -+ // DivineMC end -+ - return serverStatus; - } - -@@ -196,6 +224,12 @@ public class ServerStatus { - jsonObject.addProperty("favicon", serverStatus.getFavicon()); - } - -+ // DivineMC start - NoChatReports -+ if (gq.bxteam.divinemc.DivineConfig.noChatReportsAddQueryData) { -+ jsonObject.addProperty("preventsChatReports", true); -+ } -+ // DivineMC end -+ - return jsonObject; - } - } -diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 40f11933defbac1a5d4494e643b19af20e5997f1..fc37cbaaf0dc5994ae8e3f7fd5dd087db4e5212c 100644 ---- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -19,6 +19,8 @@ import java.util.Locale; - import java.util.Optional; - import java.util.function.BooleanSupplier; - import javax.annotation.Nullable; -+ -+import gq.bxteam.divinemc.DivineConfig; - import net.minecraft.DefaultUncaughtExceptionHandler; - import net.minecraft.DefaultUncaughtExceptionHandlerWithName; - import net.minecraft.SharedConstants; -@@ -642,7 +644,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface - - @Override - public boolean enforceSecureProfile() { -- return this.getProperties().enforceSecureProfile && this.getProperties().onlineMode; -+ return DivineConfig.noChatReportsEnable ? false : this.getProperties().enforceSecureProfile && this.getProperties().onlineMode; - } - - protected boolean convertOldUsers() { -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2ca19bbe3a71091843fc7175d726c70321d1fee3..83433dc5b9ff683bbb4949e2acfdb14193405a73 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2139,12 +2139,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - } - } - -+ // DivineMC start - NoChatReports - @Override - public void send(Packet packet) { -+ if (gq.bxteam.divinemc.DivineConfig.noChatReportsConvertToGameMessage) { -+ if (packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat) { -+ packet = new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(chat.chatType().resolve(this.player.level.registryAccess()).get().decorate(chat.unsignedContent() != null ? chat.unsignedContent() -+ : Component.literal(chat.body().content())), false); -+ } -+ } - this.send(packet, (PacketSendListener) null); - } - - public void send(Packet packet, @Nullable PacketSendListener callbacks) { -+ if (gq.bxteam.divinemc.DivineConfig.noChatReportsConvertToGameMessage) { -+ if (packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat && callbacks != null) { -+ this.send(chat); -+ return; -+ } -+ } - // CraftBukkit start - if (packet == null || this.processedDisconnect) { // Spigot - return; -@@ -2166,6 +2179,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - throw new ReportedException(crashreport); - } - } -+ // DivineMC end - - @Override - public void handleSetCarriedItem(ServerboundSetCarriedItemPacket packet) { -diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 68fb745e74ec4a0c367b0d80d7d437bd3b99a10d..cb2016596c3f519f17a0dc5e7bee0ca0c35471ba 100644 ---- a/src/main/java/net/minecraft/server/players/PlayerList.java -+++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1414,9 +1414,11 @@ public abstract class PlayerList { - - } - -+ // DivineMC start - NoChatReports - public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public -- return message.hasSignature() && !message.hasExpiredServer(Instant.now()); -+ return gq.bxteam.divinemc.DivineConfig.noChatReportsEnable ? true : message.hasSignature() && !message.hasExpiredServer(Instant.now()); - } -+ // DivineMC end - - // CraftBukkit start - public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {