Skip to content

Commit

Permalink
Fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
APickledWalrus committed Aug 16, 2020
1 parent 590d59f commit f7bfc27
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.ItemStack;
import org.eclipse.jdt.annotation.Nullable;

public class InventoryUtils {

Expand Down Expand Up @@ -71,9 +72,9 @@ public static int getInvertedSlotTo(Inventory invTo, ItemStack item) {
* @param name The name for the {@link Inventory}
* @return The created {@link Inventory}
*/
public static Inventory newInventory(InventoryType type, Integer size, String name) {
public static Inventory newInventory(InventoryType type, @Nullable Integer size, @Nullable String name) {

size = size == null ? type.getDefaultSize() : size * 9;
size = (size == null || size == 0) ? type.getDefaultSize() : size * 9;

if (name == null) {
name = type.getDefaultTitle();
Expand Down

0 comments on commit f7bfc27

Please sign in to comment.