correct argument check in PlayerHandshakeEvent#setFailMessage(String) (#7940)

This commit is contained in:
Evan 2022-06-11 02:37:00 -05:00
parent 1c4ca26d6e
commit 6a3bf07946

View file

@ -17,7 +17,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
+import org.apache.commons.lang3.Validate;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
@ -274,7 +273,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @Deprecated
+ public void setFailMessage(@NotNull String failMessage) {
+ Preconditions.checkArgument(failMessage != null && failMessage.isEmpty(), "fail message cannot be null or empty");
+ Preconditions.checkArgument(failMessage != null && !failMessage.isEmpty(), "fail message cannot be null or empty");
+ this.failMessage(LegacyComponentSerializer.legacySection().deserialize(failMessage));
+ }
+