SPIGOT-2540: Add nullability annotations to entire Bukkit API
By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user