Move to Checkerframework

This commit is contained in:
Mariell Hoversholm committed 2020-09-09 22:15:53 +02:00
1 parent 9beb9f8397
commit c949836e3c
22 files changed
+82 -76

No files matched your search

@@ -41,15 +41,15 @@ import org.apache.commons.lang.NotImplementedException;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList;
import java.util.List;
public final class CarbonUtils {
@NotNull
@NonNull
private static final String[] colors;
static {
@@ -62,8 +62,8 @@ public final class CarbonUtils {
colors = colorList.toArray(new String[0]);
}
@NotNull
public static Component createComponent(@NotNull final Player player) {
@NonNull
public static Component createComponent(@NonNull final Player player) {
if (!FunctionalityConstants.HAS_HOVER_EVENT_METHOD) {
return net.kyori.adventure.text.TextComponent.empty();
}
@@ -125,7 +125,7 @@ public final class CarbonUtils {
return TextColor.fromCSSHexString(input);
}
@NotNull
@NonNull
public static Argument onlineChatUserArgument() {
return new CustomArgument<>((input) -> {
CarbonChat carbonChat = (CarbonChat) Bukkit.getPluginManager().getPlugin("CarbonChat");
@@ -148,7 +148,7 @@ public final class CarbonUtils {
});
}
@NotNull
@NonNull
public static Argument chatUserArgument() {
return new CustomArgument<>((input) -> {
CarbonChat carbonChat = (CarbonChat) Bukkit.getPluginManager().getPlugin("CarbonChat");
@@ -165,7 +165,7 @@ public final class CarbonUtils {
});
}
@NotNull
@NonNull
public static Argument textColorArgument() {
return new CustomArgument<>((input) -> {
TextColor color = parseColor(input);
@@ -178,7 +178,7 @@ public final class CarbonUtils {
}).overrideSuggestions(colors);
}
@NotNull
@NonNull
public static Argument channelArgument() {
return new CustomArgument<>((input) -> {
CarbonChat carbonChat = (CarbonChat) Bukkit.getPluginManager().getPlugin("CarbonChat");