From 5b9dbb74c9963a765f6963cfedc22104f1196909 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 29 Jun 2020 10:42:01 -0400 Subject: [PATCH] Fix up some annotations --- .../java/com/velocitypowered/api/event/ResultedEvent.java | 1 + .../api/event/player/KickedFromServerEvent.java | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/event/ResultedEvent.java b/api/src/main/java/com/velocitypowered/api/event/ResultedEvent.java index 22e6fc230..2785d3eee 100644 --- a/api/src/main/java/com/velocitypowered/api/event/ResultedEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/ResultedEvent.java @@ -93,6 +93,7 @@ public interface ResultedEvent { return status; } + @Deprecated public Optional getReason() { return Optional.ofNullable(reason).map(AdventureCompat::asOriginalTextComponent); } diff --git a/api/src/main/java/com/velocitypowered/api/event/player/KickedFromServerEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/KickedFromServerEvent.java index 7f4a1208a..677848b7b 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/KickedFromServerEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/KickedFromServerEvent.java @@ -21,7 +21,7 @@ public final class KickedFromServerEvent implements private final Player player; private final RegisteredServer server; - private final net.kyori.adventure.text.Component originalReason; + private final net.kyori.adventure.text.@Nullable Component originalReason; private final boolean duringServerConnect; private ServerKickResult result; @@ -63,7 +63,7 @@ public final class KickedFromServerEvent implements * @param result the initial result */ public KickedFromServerEvent(Player player, RegisteredServer server, - net.kyori.adventure.text.Component originalReason, + net.kyori.adventure.text.@Nullable Component originalReason, boolean duringServerConnect, ServerKickResult result) { this.player = Preconditions.checkNotNull(player, "player"); this.server = Preconditions.checkNotNull(server, "server"); @@ -189,7 +189,8 @@ public final class KickedFromServerEvent implements private final net.kyori.adventure.text.Component message; private final RegisteredServer server; - private RedirectPlayer(RegisteredServer server, net.kyori.adventure.text.Component message) { + private RedirectPlayer(RegisteredServer server, + net.kyori.adventure.text.@Nullable Component message) { this.server = Preconditions.checkNotNull(server, "server"); this.message = message; } @@ -252,7 +253,6 @@ public final class KickedFromServerEvent implements private final net.kyori.adventure.text.Component message; - @Deprecated private Notify(net.kyori.adventure.text.Component message) { this.message = Preconditions.checkNotNull(message, "message"); }