mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-17 09:26:58 +02:00
SPIGOT-4439: Allow minecraft:brand channel for use by plugins.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
7bde974727
commit
017a3c55d7
@ -27,6 +27,9 @@ public interface Messenger {
|
||||
|
||||
/**
|
||||
* Checks if the specified channel is a reserved name.
|
||||
* <br>
|
||||
* All channels within the "minecraft" namespace except for
|
||||
* "minecraft:brand" are reserved.
|
||||
*
|
||||
* @param channel Channel name to check.
|
||||
* @return True if the channel is reserved, otherwise false.
|
||||
|
@ -170,7 +170,7 @@ public class StandardMessenger implements Messenger {
|
||||
public boolean isReservedChannel(String channel) {
|
||||
channel = validateAndCorrectChannel(channel);
|
||||
|
||||
return channel.contains("minecraft");
|
||||
return channel.contains("minecraft") && !channel.equals("minecraft:brand");
|
||||
}
|
||||
|
||||
public void registerOutgoingPluginChannel(Plugin plugin, String channel) {
|
||||
|
@ -27,6 +27,7 @@ public class StandardMessengerTest {
|
||||
assertTrue(messenger.isReservedChannel("minecraft:unregister"));
|
||||
assertFalse(messenger.isReservedChannel("test:nregister"));
|
||||
assertTrue(messenger.isReservedChannel("minecraft:something"));
|
||||
assertFalse(messenger.isReservedChannel("minecraft:brand"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user