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

@@ -5,6 +5,8 @@ import org.bukkit.World;
import org.bukkit.inventory.DoubleChestInventory;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a double chest.
@@ -12,26 +14,31 @@ import org.bukkit.inventory.InventoryHolder;
public class DoubleChest implements InventoryHolder {
private DoubleChestInventory inventory;
public DoubleChest(DoubleChestInventory chest) {
public DoubleChest(@NotNull DoubleChestInventory chest) {
inventory = chest;
}
@NotNull
public Inventory getInventory() {
return inventory;
}
@Nullable
public InventoryHolder getLeftSide() {
return inventory.getLeftSide().getHolder();
}
@Nullable
public InventoryHolder getRightSide() {
return inventory.getRightSide().getHolder();
}
@NotNull
public Location getLocation() {
return getInventory().getLocation();
}
@Nullable
public World getWorld() {
return getLocation().getWorld();
}