mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
SPIGOT-2540: Add nullability annotations to entire Bukkit API
By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
@@ -6,6 +6,8 @@ import com.google.common.collect.Maps;
|
||||
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.potion.Potion;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* A list of effects that the server is able to send to players.
|
||||
@@ -203,11 +205,11 @@ public enum Effect {
|
||||
private final Class<?> data;
|
||||
private static final Map<Integer, Effect> BY_ID = Maps.newHashMap();
|
||||
|
||||
Effect(int id, Type type) {
|
||||
Effect(int id, @NotNull Type type) {
|
||||
this(id, type, null);
|
||||
}
|
||||
|
||||
Effect(int id, Type type, Class<?> data) {
|
||||
Effect(int id, @NotNull Type type, @Nullable Class<?> data) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
this.data = data;
|
||||
@@ -227,6 +229,7 @@ public enum Effect {
|
||||
/**
|
||||
* @return The type of the effect.
|
||||
*/
|
||||
@NotNull
|
||||
public Type getType() {
|
||||
return this.type;
|
||||
}
|
||||
@@ -235,6 +238,7 @@ public enum Effect {
|
||||
* @return The class which represents data for this effect, or null if
|
||||
* none
|
||||
*/
|
||||
@Nullable
|
||||
public Class<?> getData() {
|
||||
return this.data;
|
||||
}
|
||||
@@ -247,6 +251,7 @@ public enum Effect {
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
@Nullable
|
||||
public static Effect getById(int id) {
|
||||
return BY_ID.get(id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user