Change the reserved channel check to be sensible

This commit is contained in:
DoNotSpamPls 2018-10-23 19:32:55 +03:00
parent df6c6062ab
commit ad83a72cf5
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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"));
}