Skip to content

Commit

Permalink
correct argument check in PlayerHandshakeEvent#setFailMessage(String) (
Browse files Browse the repository at this point in the history
  • Loading branch information
e-im authored Jun 11, 2022
1 parent ee7d161 commit f8beab5
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client

diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..0f533119af49f77b5e84a68c24b9d4e1b28663f1
index 0000000000000000000000000000000000000000..59ae7bc3a0a2079fe4b3a92d777aca682a58e4e3
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
@@ -0,0 +1,278 @@
@@ -0,0 +1,277 @@
+package com.destroystokyo.paper.event.player;
+
+import com.google.common.base.Preconditions;
+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;
Expand Down Expand Up @@ -274,7 +273,7 @@ index 0000000000000000000000000000000000000000..0f533119af49f77b5e84a68c24b9d4e1
+ */
+ @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));
+ }
+
Expand Down

0 comments on commit f8beab5

Please sign in to comment.