From f7c65f38d1b4bb606797bda161efb1ab276e6672 Mon Sep 17 00:00:00 2001 From: onebeastchris Date: Thu, 2 May 2024 12:51:14 +0200 Subject: [PATCH] properly annotate methods in the ServerTransferEvent --- .../geyser/api/event/java/ServerTransferEvent.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/org/geysermc/geyser/api/event/java/ServerTransferEvent.java b/api/src/main/java/org/geysermc/geyser/api/event/java/ServerTransferEvent.java index b3b580ec3..594e28ef0 100644 --- a/api/src/main/java/org/geysermc/geyser/api/event/java/ServerTransferEvent.java +++ b/api/src/main/java/org/geysermc/geyser/api/event/java/ServerTransferEvent.java @@ -26,6 +26,7 @@ package org.geysermc.geyser.api.event.java; import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.common.value.qual.IntRange; import org.geysermc.geyser.api.connection.GeyserConnection; import org.geysermc.geyser.api.event.connection.ConnectionEvent; @@ -44,7 +45,8 @@ public class ServerTransferEvent extends ConnectionEvent { private int bedrockPort; private final Map cookies; - public ServerTransferEvent(@NonNull GeyserConnection connection, String host, int port, Map cookies) { + public ServerTransferEvent(@NonNull GeyserConnection connection, + @NonNull String host, int port, @NonNull Map cookies) { super(connection); this.host = host; this.port = port; @@ -58,7 +60,7 @@ public class ServerTransferEvent extends ConnectionEvent { * * @return the host */ - public String host() { + public @NonNull String host() { return this.host; } @@ -77,7 +79,7 @@ public class ServerTransferEvent extends ConnectionEvent { * * @return the host where the Bedrock client will be transferred to, or null if not set. */ - public String bedrockHost() { + public @Nullable String bedrockHost() { return this.bedrockHost; }