From f17519338bc589c045e0b32bfc37e048b23544d5 Mon Sep 17 00:00:00 2001 From: Riley Park Date: Wed, 15 May 2024 17:06:59 -0700 Subject: Expose server build information (#10729) * Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic Co-authored-by: masmc05 --- ...the-reserved-channel-check-to-be-sensible.patch | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 patches/api/0162-Change-the-reserved-channel-check-to-be-sensible.patch (limited to 'patches/api/0162-Change-the-reserved-channel-check-to-be-sensible.patch') diff --git a/patches/api/0162-Change-the-reserved-channel-check-to-be-sensible.patch b/patches/api/0162-Change-the-reserved-channel-check-to-be-sensible.patch new file mode 100644 index 0000000000..8975ff3c43 --- /dev/null +++ b/patches/api/0162-Change-the-reserved-channel-check-to-be-sensible.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: DoNotSpamPls <7570108+DoNotSpamPls@users.noreply.github.com> +Date: Tue, 23 Oct 2018 19:32:55 +0300 +Subject: [PATCH] Change the reserved channel check to be sensible + + +diff --git a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java +index 1d061412cdafa28c6940c7433747ab1dabe23de1..6fda7f3aa68e76af64362e9afed70fc6a5e92986 100644 +--- a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java ++++ b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java +@@ -172,7 +172,7 @@ public class StandardMessenger implements Messenger { + public boolean isReservedChannel(@NotNull String channel) { + channel = validateAndCorrectChannel(channel); + +- return channel.contains("minecraft") && !channel.equals("minecraft:brand"); ++ return channel.equals("minecraft:register") || channel.equals("minecraft:unregister"); // Paper + } + + @Override +diff --git a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java +index 144ae2f31badb8142bc4a76a7abab37a57118191..8ffaa33d97c045c0fd6851ec2f189344b4a070d2 100644 +--- a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java ++++ b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java +@@ -26,8 +26,8 @@ public class StandardMessengerTest { + assertTrue(messenger.isReservedChannel("minecraft:register")); + assertFalse(messenger.isReservedChannel("test:register")); + assertTrue(messenger.isReservedChannel("minecraft:unregister")); +- assertFalse(messenger.isReservedChannel("test:nregister")); +- assertTrue(messenger.isReservedChannel("minecraft:something")); ++ assertFalse(messenger.isReservedChannel("test:unregister")); // Paper - fix typo ++ assertFalse(messenger.isReservedChannel("minecraft:something")); // Paper - now less strict + assertFalse(messenger.isReservedChannel("minecraft:brand")); + } + -- cgit v1.2.3