2019-05-27 09:13:41 +00:00
|
|
|
From b36a48e067fabe4f9108ef31f6ce6d1373627bf5 Mon Sep 17 00:00:00 2001
|
2018-12-01 00:08:31 +00:00
|
|
|
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
|
2019-05-06 02:58:04 +00:00
|
|
|
index 1d061412..6fda7f3a 100644
|
2018-12-01 00:08:31 +00:00
|
|
|
--- a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java
|
|
|
|
+++ b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java
|
2019-05-06 02:58:04 +00:00
|
|
|
@@ -172,7 +172,7 @@ public class StandardMessenger implements Messenger {
|
2019-03-20 00:28:15 +00:00
|
|
|
public boolean isReservedChannel(@NotNull String channel) {
|
2018-12-01 00:08:31 +00:00
|
|
|
channel = validateAndCorrectChannel(channel);
|
|
|
|
|
|
|
|
- return channel.contains("minecraft") && !channel.equals("minecraft:brand");
|
|
|
|
+ return channel.equals("minecraft:register") || channel.equals("minecraft:unregister"); // Paper
|
|
|
|
}
|
|
|
|
|
2019-05-06 02:58:04 +00:00
|
|
|
@Override
|
2018-12-01 00:08:31 +00:00
|
|
|
diff --git a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java
|
2019-05-06 02:58:04 +00:00
|
|
|
index dce3d619..7e2335ed 100644
|
2018-12-01 00:08:31 +00:00
|
|
|
--- a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java
|
|
|
|
+++ b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java
|
|
|
|
@@ -25,8 +25,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"));
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2019-04-23 04:47:07 +00:00
|
|
|
2.21.0
|
2018-12-01 00:08:31 +00:00
|
|
|
|