From 3aee47166f495265ae7bc77a67076dd6ccd3fca5 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 9 Feb 2021 14:36:10 -0500 Subject: [PATCH] Allow clearing favicon in ServerPing builder. --- .../com/velocitypowered/api/proxy/server/ServerPing.java | 5 +++++ .../api/proxy/messages/MinecraftChannelIdentifierTest.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java index dcb44f7ff..dc9b7fc40 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java @@ -262,6 +262,11 @@ public final class ServerPing { return this; } + public Builder clearFavicon() { + this.favicon = null; + return this; + } + /** * Uses the information from this builder to create a new {@link ServerPing} instance. The * builder can be re-used after this event has been called. diff --git a/api/src/test/java/com/velocitypowered/api/proxy/messages/MinecraftChannelIdentifierTest.java b/api/src/test/java/com/velocitypowered/api/proxy/messages/MinecraftChannelIdentifierTest.java index dfa738198..e7f02e95a 100644 --- a/api/src/test/java/com/velocitypowered/api/proxy/messages/MinecraftChannelIdentifierTest.java +++ b/api/src/test/java/com/velocitypowered/api/proxy/messages/MinecraftChannelIdentifierTest.java @@ -35,6 +35,11 @@ class MinecraftChannelIdentifierTest { assertEquals(expected, MinecraftChannelIdentifier.from("velocity:test")); } + @Test + void createAllowsSlashes() { + create("velocity", "test/test2"); + } + @Test void fromIdentifierThrowsOnBadValues() { assertAll(