diff --git a/invui/src/main/java/xyz/xenondevs/invui/window/AbstractWindow.java b/invui/src/main/java/xyz/xenondevs/invui/window/AbstractWindow.java index b4b582a..962f42b 100644 --- a/invui/src/main/java/xyz/xenondevs/invui/window/AbstractWindow.java +++ b/invui/src/main/java/xyz/xenondevs/invui/window/AbstractWindow.java @@ -321,7 +321,7 @@ public abstract class AbstractWindow implements Window, GuiParent { } @Override - public void setOpenHandlers(@NotNull List<@NotNull Runnable> openHandlers) { + public void setOpenHandlers(@Nullable List<@NotNull Runnable> openHandlers) { this.openHandlers = openHandlers; } @@ -334,7 +334,7 @@ public abstract class AbstractWindow implements Window, GuiParent { } @Override - public void setCloseHandlers(@NotNull List<@NotNull Runnable> closeHandlers) { + public void setCloseHandlers(@Nullable List<@NotNull Runnable> closeHandlers) { this.closeHandlers = closeHandlers; } @@ -353,7 +353,7 @@ public abstract class AbstractWindow implements Window, GuiParent { } @Override - public void setOutsideClickHandlers(@NotNull List<@NotNull Consumer<@NotNull InventoryClickEvent>> outsideClickHandlers) { + public void setOutsideClickHandlers(@Nullable List<@NotNull Consumer<@NotNull InventoryClickEvent>> outsideClickHandlers) { this.outsideClickHandlers = outsideClickHandlers; } @@ -477,13 +477,13 @@ public abstract class AbstractWindow implements Window, GuiParent { } @Override - public @NotNull S setOpenHandlers(List openHandlers) { + public @NotNull S setOpenHandlers(@Nullable List<@NotNull Runnable> openHandlers) { this.openHandlers = openHandlers; return (S) this; } @Override - public @NotNull S addOpenHandler(Runnable openHandler) { + public @NotNull S addOpenHandler(@NotNull Runnable openHandler) { if (openHandlers == null) openHandlers = new ArrayList<>(); @@ -492,13 +492,13 @@ public abstract class AbstractWindow implements Window, GuiParent { } @Override - public @NotNull S setCloseHandlers(List closeHandlers) { + public @NotNull S setCloseHandlers(@Nullable List<@NotNull Runnable> closeHandlers) { this.closeHandlers = closeHandlers; return (S) this; } @Override - public @NotNull S addCloseHandler(Runnable closeHandler) { + public @NotNull S addCloseHandler(@NotNull Runnable closeHandler) { if (closeHandlers == null) closeHandlers = new ArrayList<>(); @@ -522,13 +522,13 @@ public abstract class AbstractWindow implements Window, GuiParent { } @Override - public @NotNull S setModifiers(List> modifiers) { + public @NotNull S setModifiers(@Nullable List<@NotNull Consumer<@NotNull Window>> modifiers) { this.modifiers = modifiers; return (S) this; } @Override - public @NotNull S addModifier(Consumer modifier) { + public @NotNull S addModifier(@NotNull Consumer<@NotNull Window> modifier) { if (modifiers == null) modifiers = new ArrayList<>(); diff --git a/invui/src/main/java/xyz/xenondevs/invui/window/Window.java b/invui/src/main/java/xyz/xenondevs/invui/window/Window.java index 1ddbf6f..edf7fcd 100644 --- a/invui/src/main/java/xyz/xenondevs/invui/window/Window.java +++ b/invui/src/main/java/xyz/xenondevs/invui/window/Window.java @@ -167,7 +167,7 @@ public interface Window { * * @param openHandlers The new open handlers */ - void setOpenHandlers(@NotNull List<@NotNull Runnable> openHandlers); + void setOpenHandlers(@Nullable List<@NotNull Runnable> openHandlers); /** * Adds an open handler that will be called when this window gets opened. @@ -181,7 +181,7 @@ public interface Window { * * @param closeHandlers The new close handlers */ - void setCloseHandlers(@NotNull List<@NotNull Runnable> closeHandlers); + void setCloseHandlers(@Nullable List<@NotNull Runnable> closeHandlers); /** * Adds a close handler that will be called when this window gets closed. @@ -199,9 +199,10 @@ public interface Window { /** * Replaces the currently registered outside click handlers with the given list. + * * @param outsideClickHandlers The new outside click handlers */ - void setOutsideClickHandlers(@NotNull List<@NotNull Consumer<@NotNull InventoryClickEvent>> outsideClickHandlers); + void setOutsideClickHandlers(@Nullable List<@NotNull Consumer<@NotNull InventoryClickEvent>> outsideClickHandlers); /** * Adds an outside click handler that will be called when a player clicks outside the inventory. @@ -277,7 +278,7 @@ public interface Window { * @return This {@link Builder Window Builder} */ @Contract("_ -> this") - @NotNull S setOpenHandlers(List openHandlers); + @NotNull S setOpenHandlers(@Nullable List<@NotNull Runnable> openHandlers); /** * Adds an open handler to the {@link Window}. @@ -286,7 +287,7 @@ public interface Window { * @return This {@link Builder Window Builder} */ @Contract("_ -> this") - @NotNull S addOpenHandler(Runnable openHandler); + @NotNull S addOpenHandler(@NotNull Runnable openHandler); /** * Sets the close handlers of the {@link Window}. @@ -295,7 +296,7 @@ public interface Window { * @return This {@link Builder Window Builder} */ @Contract("_ -> this") - @NotNull S setCloseHandlers(List closeHandlers); + @NotNull S setCloseHandlers(@Nullable List<@NotNull Runnable> closeHandlers); /** * Adds a close handler to the {@link Window}. @@ -304,7 +305,7 @@ public interface Window { * @return This {@link Builder Window Builder} */ @Contract("_ -> this") - @NotNull S addCloseHandler(Runnable closeHandler); + @NotNull S addCloseHandler(@NotNull Runnable closeHandler); /** * Sets the outside click handlers of the {@link Window}. @@ -331,7 +332,7 @@ public interface Window { * @return This {@link Builder Window Builder} */ @Contract("_ -> this") - @NotNull S setModifiers(List> modifiers); + @NotNull S setModifiers(@Nullable List<@NotNull Consumer<@NotNull Window>> modifiers); /** * Adds a modifier to the {@link Window}. @@ -340,7 +341,7 @@ public interface Window { * @return This {@link Builder Window Builder} */ @Contract("_ -> this") - @NotNull S addModifier(Consumer modifier); + @NotNull S addModifier(@NotNull Consumer<@NotNull Window> modifier); /** * Builds the {@link Window}.