SPIGOT-2540: Add nullability annotations to entire Bukkit API

By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
Bukkit/Spigot
2019-03-13 17:42:57 +11:00
parent e069a80fd8
commit 416c865476
565 changed files with 5372 additions and 2008 deletions

View File

@@ -6,15 +6,19 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.BeaconInventory;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a captured state of a beacon.
*/
public interface Beacon extends Container, Nameable {
@NotNull
@Override
BeaconInventory getInventory();
@NotNull
@Override
BeaconInventory getSnapshotInventory();
@@ -27,6 +31,7 @@ public interface Beacon extends Container, Nameable {
* @return the players in range
* @throws IllegalStateException if this block state is not placed
*/
@NotNull
Collection<LivingEntity> getEntitiesInRange();
/**
@@ -43,6 +48,7 @@ public interface Beacon extends Container, Nameable {
*
* @return the primary effect or null if not set
*/
@Nullable
PotionEffect getPrimaryEffect();
/**
@@ -50,13 +56,14 @@ public interface Beacon extends Container, Nameable {
*
* @param effect new primary effect
*/
void setPrimaryEffect(PotionEffectType effect);
void setPrimaryEffect(@Nullable PotionEffectType effect);
/**
* Returns the secondary effect set on the beacon.
*
* @return the secondary effect or null if no secondary effect
*/
@Nullable
PotionEffect getSecondaryEffect();
/**
@@ -65,5 +72,5 @@ public interface Beacon extends Container, Nameable {
*
* @param effect desired secondary effect
*/
void setSecondaryEffect(PotionEffectType effect);
void setSecondaryEffect(@Nullable PotionEffectType effect);
}