diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java index b02b31b..ec29ff2 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungeeAPI.java @@ -210,7 +210,7 @@ public class RedisBungeeAPI { * @return the name for the UUID * @since 0.3 */ - public final String getNameFromUuid(UUID uuid) { + public final String getNameFromUuid(@NonNull UUID uuid) { return plugin.getUuidTranslator().getNameFromUuid(uuid); } @@ -222,7 +222,7 @@ public class RedisBungeeAPI { * @return the UUID for the name * @since 0.3 */ - public final UUID getUuidFromName(String name) { + public final UUID getUuidFromName(@NonNull String name) { return plugin.getUuidTranslator().getTranslatedUuid(name); } } diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java index 4faf5e8..6606858 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java @@ -11,6 +11,7 @@ import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.google.common.collect.Maps; import com.imaginarycode.minecraft.redisbungee.RedisBungee; +import lombok.NonNull; import lombok.RequiredArgsConstructor; import net.md_5.bungee.api.ProxyServer; import redis.clients.jedis.Jedis; @@ -28,7 +29,7 @@ public class UUIDTranslator { public static final Pattern UUID_PATTERN = Pattern.compile("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"); public static final Pattern MOJANGIAN_UUID_PATTERN = Pattern.compile("[a-fA-F0-9]{32}"); - public UUID getTranslatedUuid(String player) { + public UUID getTranslatedUuid(@NonNull String player) { if (ProxyServer.getInstance().getPlayer(player) != null) return ProxyServer.getInstance().getPlayer(player).getUniqueId(); @@ -81,7 +82,7 @@ public class UUIDTranslator { } } - public String getNameFromUuid(UUID player) { + public String getNameFromUuid(@NonNull UUID player) { if (ProxyServer.getInstance().getPlayer(player) != null) return ProxyServer.getInstance().getPlayer(player).getName();