From 8d61e7ffd084c7696cd682fdd2e4d8ebd70cb0e3 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sun, 2 Jun 2019 17:57:31 -0400 Subject: [PATCH] Removed redundant (non-)nullable annotations from boss bar. --- .../api/util/bossbar/BossBar.java | 14 ++++------- .../proxy/util/bossbar/VelocityBossBar.java | 24 +++++++++---------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/util/bossbar/BossBar.java b/api/src/main/java/com/velocitypowered/api/util/bossbar/BossBar.java index d5bf30744..65ebe3623 100644 --- a/api/src/main/java/com/velocitypowered/api/util/bossbar/BossBar.java +++ b/api/src/main/java/com/velocitypowered/api/util/bossbar/BossBar.java @@ -3,7 +3,6 @@ package com.velocitypowered.api.util.bossbar; import com.velocitypowered.api.proxy.Player; import java.util.Collection; import net.kyori.text.Component; -import org.checkerframework.checker.nullness.qual.NonNull; /** * Represents a boss bar, which can be send to a (group of) player(s). @@ -25,7 +24,7 @@ public interface BossBar { * * @param player the player you wish to add */ - void addPlayer(@NonNull Player player); + void addPlayer(Player player); /** * Removes player from this boss bar. This removes the player from {@link #getPlayers()} and makes @@ -33,7 +32,7 @@ public interface BossBar { * * @param player the player you wish to remove */ - void removePlayer(@NonNull Player player); + void removePlayer(Player player); /** * Removes all specified players from this boss bar. @@ -55,7 +54,6 @@ public interface BossBar { * * @return title */ - @NonNull Component getTitle(); /** @@ -63,7 +61,7 @@ public interface BossBar { * * @param title new title */ - void setTitle(@NonNull Component title); + void setTitle(Component title); /** * Gets the boss bar's percent. @@ -93,7 +91,6 @@ public interface BossBar { * * @return boss bar color */ - @NonNull BossBarColor getColor(); /** @@ -101,14 +98,13 @@ public interface BossBar { * * @param color the color you wish the boss bar be displayed with */ - void setColor(@NonNull BossBarColor color); + void setColor(BossBarColor color); /** * Gets the overlay of the boss bar. * * @return boss bar overlay */ - @NonNull BossBarOverlay getOverlay(); /** @@ -116,7 +112,7 @@ public interface BossBar { * * @param overlay the overlay you wish the boss bar be displayed with */ - void setOverlay(@NonNull BossBarOverlay overlay); + void setOverlay(BossBarOverlay overlay); /** * Returns whenever this boss bar is visible to all added {@link #getPlayers()}. By default, it diff --git a/proxy/src/main/java/com/velocitypowered/proxy/util/bossbar/VelocityBossBar.java b/proxy/src/main/java/com/velocitypowered/proxy/util/bossbar/VelocityBossBar.java index aca1ecb9a..98dc81d50 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/util/bossbar/VelocityBossBar.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/util/bossbar/VelocityBossBar.java @@ -20,8 +20,6 @@ import java.util.Set; import java.util.UUID; import net.kyori.text.Component; import net.kyori.text.serializer.gson.GsonComponentSerializer; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; public class VelocityBossBar implements com.velocitypowered.api.util.bossbar.BossBar { @@ -55,7 +53,7 @@ public class VelocityBossBar implements com.velocitypowered.api.util.bossbar.Bos } @Override - public void addPlayers(@NonNull Iterable players) { + public void addPlayers(Iterable players) { checkNotNull(players, "players"); for (Player player : players) { addPlayer(player); @@ -63,7 +61,7 @@ public class VelocityBossBar implements com.velocitypowered.api.util.bossbar.Bos } @Override - public void addPlayer(@NonNull Player player) { + public void addPlayer(Player player) { checkNotNull(player, "player"); if (!players.contains(player)) { players.add(player); @@ -74,7 +72,7 @@ public class VelocityBossBar implements com.velocitypowered.api.util.bossbar.Bos } @Override - public void removePlayer(@NonNull Player player) { + public void removePlayer(Player player) { checkNotNull(player, "player"); players.remove(player); if (player.isActive()) { @@ -83,7 +81,7 @@ public class VelocityBossBar implements com.velocitypowered.api.util.bossbar.Bos } @Override - public void removePlayers(@NonNull Iterable players) { + public void removePlayers(Iterable players) { checkNotNull(players, "players"); for (Player player : players) { removePlayer(player); @@ -96,12 +94,12 @@ public class VelocityBossBar implements com.velocitypowered.api.util.bossbar.Bos } @Override - public @NonNull Component getTitle() { + public Component getTitle() { return title; } @Override - public void setTitle(@NonNull Component title) { + public void setTitle(Component title) { this.title = checkNotNull(title, "title"); if (visible) { BossBar bar = new BossBar(); @@ -137,17 +135,17 @@ public class VelocityBossBar implements com.velocitypowered.api.util.bossbar.Bos } @Override - public @Nullable Collection getPlayers() { + public Collection getPlayers() { return ImmutableList.copyOf(players); } @Override - public @NonNull BossBarColor getColor() { + public BossBarColor getColor() { return color; } @Override - public void setColor(@NonNull BossBarColor color) { + public void setColor(BossBarColor color) { this.color = checkNotNull(color, "color"); if (visible) { sendDivisions(color, overlay); @@ -155,12 +153,12 @@ public class VelocityBossBar implements com.velocitypowered.api.util.bossbar.Bos } @Override - public @NonNull BossBarOverlay getOverlay() { + public BossBarOverlay getOverlay() { return overlay; } @Override - public void setOverlay(@NonNull BossBarOverlay overlay) { + public void setOverlay(BossBarOverlay overlay) { this.overlay = checkNotNull(overlay, "overlay"); if (visible) { sendDivisions(color, overlay);