Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Removed redundant (non-)nullable annotations from boss bar.
Dieser Commit ist enthalten in:
Ursprung
0a53343547
Commit
8d61e7ffd0
@ -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
|
||||
|
@ -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<Player> players) {
|
||||
public void addPlayers(Iterable<Player> 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<Player> players) {
|
||||
public void removePlayers(Iterable<Player> 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<Player> getPlayers() {
|
||||
public Collection<Player> 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);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren