Skip to content

Commit

Permalink
add some contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
Snabeldier committed Jan 19, 2025
1 parent e7ee128 commit d8b4561
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/minevalley/core/api/gui/MultiPageGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public interface MultiPageGui extends InventoryGui {
* @throws IllegalArgumentException if the slot is out of bounds
*/
@Nullable
@Contract(pure = true)
ItemStack getItem(@Nonnegative int page, @Nonnegative int slot) throws IllegalArgumentException;

/**
Expand All @@ -35,6 +36,7 @@ public interface MultiPageGui extends InventoryGui {
* @throws IllegalArgumentException if the slot is out of bounds
*/
@Override
@Contract(pure = true)
default @Nullable ItemStack getItem(@Nonnegative int slot) throws IllegalArgumentException {
return getItem(0, slot);
}
Expand Down Expand Up @@ -103,6 +105,7 @@ MultiPageGui setPageDependantItem(@Nonnegative int slot, @Nonnull Function<Integ
* @throws IllegalArgumentException if the page is out of bounds
*/
@Nonnull
@Contract("_ -> new")
InventoryGui getInventory(@Nonnegative int page) throws IllegalArgumentException;

/**
Expand Down Expand Up @@ -135,6 +138,7 @@ MultiPageGui setPageDependantItem(@Nonnegative int slot, @Nonnull Function<Integ
* @return a copy of the underlying inventory of this GUI
*/
@Override
@Contract("-> new")
default @Nonnull Inventory getInventory() {
return getInventory(0).getInventory();
}
Expand Down

0 comments on commit d8b4561

Please sign in to comment.