diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/Gui.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/Gui.java index 348d76c..aa9a04e 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/Gui.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/Gui.java @@ -8,9 +8,9 @@ import org.jetbrains.annotations.Nullable; import xyz.xenondevs.invui.animation.Animation; import xyz.xenondevs.invui.gui.structure.Marker; import xyz.xenondevs.invui.gui.structure.Structure; +import xyz.xenondevs.invui.inventory.Inventory; import xyz.xenondevs.invui.item.Item; import xyz.xenondevs.invui.item.ItemProvider; -import xyz.xenondevs.invui.inventory.Inventory; import xyz.xenondevs.invui.window.Window; import xyz.xenondevs.invui.window.WindowManager; @@ -369,23 +369,23 @@ public interface Gui { /** * Fills a rectangle with a {@link Inventory} in this {@link Gui}. * - * @param x The x coordinate where the rectangle should start - * @param y The y coordinate where the rectangle should start - * @param width The line length of the rectangle. - * @param inventory The {@link Inventory} to be put into this {@link Gui}. - * @param replaceExisting If existing {@link SlotElement SlotElements} should be replaced. + * @param x The x coordinate where the rectangle should start + * @param y The y coordinate where the rectangle should start + * @param width The line length of the rectangle. + * @param inventory The {@link Inventory} to be put into this {@link Gui}. + * @param replaceExisting If existing {@link SlotElement SlotElements} should be replaced. */ void fillRectangle(int x, int y, int width, @NotNull Inventory inventory, boolean replaceExisting); /** * Fills a rectangle with a {@link Inventory} in this {@link Gui}. * - * @param x The x coordinate where the rectangle should start - * @param y The y coordinate where the rectangle should start - * @param width The line length of the rectangle. - * @param inventory The {@link Inventory} to be put into this {@link Gui}. - * @param background The {@link ItemProvider} for empty slots of the {@link Inventory} - * @param replaceExisting If existing {@link SlotElement SlotElements} should be replaced. + * @param x The x coordinate where the rectangle should start + * @param y The y coordinate where the rectangle should start + * @param width The line length of the rectangle. + * @param inventory The {@link Inventory} to be put into this {@link Gui}. + * @param background The {@link ItemProvider} for empty slots of the {@link Inventory} + * @param replaceExisting If existing {@link SlotElement SlotElements} should be replaced. */ void fillRectangle(int x, int y, int width, @NotNull Inventory inventory, @Nullable ItemProvider background, boolean replaceExisting); diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/NormalGuiImpl.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/NormalGuiImpl.java index 6d27173..3db7ac0 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/NormalGuiImpl.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/NormalGuiImpl.java @@ -34,12 +34,12 @@ final class NormalGuiImpl extends AbstractGui { public @NotNull Gui build() { if (structure == null) throw new IllegalStateException("Structure is not defined."); - + var gui = new NormalGuiImpl(structure); applyModifiers(gui); return gui; } - + } } diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/PagedGui.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/PagedGui.java index 26dd896..ac514ae 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/PagedGui.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/PagedGui.java @@ -134,7 +134,7 @@ public interface PagedGui extends Gui { * * @param width The width of the {@link PagedGui}. * @param height The height of the {@link PagedGui}. - * @param inventories The {@link Inventory Inventories} to use as pages. + * @param inventories The {@link Inventory Inventories} to use as pages. * @param contentListSlots The slots where content should be displayed. * @return The created {@link PagedGui}. */ @@ -145,8 +145,8 @@ public interface PagedGui extends Gui { /** * Creates a new {@link PagedGui}. * - * @param structure The {@link Structure} to use. - * @param inventories The {@link Inventory Inventories} to use as pages. + * @param structure The {@link Structure} to use. + * @param inventories The {@link Inventory Inventories} to use as pages. * @return The created {@link PagedGui}. */ static @NotNull PagedGui<@NotNull Inventory> ofInventories(@NotNull Structure structure, @NotNull List<@NotNull Inventory> inventories) { diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/PagedInventoriesGuiImpl.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/PagedInventoriesGuiImpl.java index 6e4f06a..eabbd52 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/PagedInventoriesGuiImpl.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/PagedInventoriesGuiImpl.java @@ -25,7 +25,7 @@ final class PagedInventoriesGuiImpl extends AbstractPagedGui { * * @param width The width of this Gui. * @param height The height of this Gui. - * @param inventories The {@link Inventory Inventories} to use as pages. + * @param inventories The {@link Inventory Inventories} to use as pages. * @param contentListSlots The slots where content should be displayed. */ public PagedInventoriesGuiImpl(int width, int height, @Nullable List<@NotNull Inventory> inventories, int... contentListSlots) { @@ -36,8 +36,8 @@ final class PagedInventoriesGuiImpl extends AbstractPagedGui { /** * Creates a new {@link PagedInventoriesGuiImpl}. * - * @param inventories The {@link Inventory Inventories} to use as pages. - * @param structure The {@link Structure} to use. + * @param inventories The {@link Inventory Inventories} to use as pages. + * @param structure The {@link Structure} to use. */ public PagedInventoriesGuiImpl(@Nullable List<@NotNull Inventory> inventories, @NotNull Structure structure) { super(structure.getWidth(), structure.getHeight(), false, structure); diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/ScrollGui.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/ScrollGui.java index 5f15a44..4fff2c8 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/ScrollGui.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/ScrollGui.java @@ -4,8 +4,8 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import xyz.xenondevs.invui.gui.structure.Structure; -import xyz.xenondevs.invui.item.Item; import xyz.xenondevs.invui.inventory.Inventory; +import xyz.xenondevs.invui.item.Item; import java.util.List; import java.util.function.BiConsumer; diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/ScrollInventoryGuiImpl.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/ScrollInventoryGuiImpl.java index 9c66f67..1d79325 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/ScrollInventoryGuiImpl.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/ScrollInventoryGuiImpl.java @@ -10,7 +10,7 @@ import java.util.List; /** * A {@link AbstractScrollGui} that uses {@link Inventory VirtualInventories} as content. - * + * * @see ScrollItemsGuiImpl * @see ScrollNestedGuiImpl */ diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/SlotElement.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/SlotElement.java index 5f93279..ab9cf6f 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/SlotElement.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/SlotElement.java @@ -1,9 +1,9 @@ package xyz.xenondevs.invui.gui; import org.bukkit.inventory.ItemStack; +import xyz.xenondevs.invui.inventory.Inventory; import xyz.xenondevs.invui.item.Item; import xyz.xenondevs.invui.item.ItemProvider; -import xyz.xenondevs.invui.inventory.Inventory; import java.util.ArrayList; import java.util.List; diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/InventorySlotElementSupplier.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/InventorySlotElementSupplier.java index 5c61b12..50cdc4a 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/InventorySlotElementSupplier.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/InventorySlotElementSupplier.java @@ -4,8 +4,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import xyz.xenondevs.invui.gui.SlotElement; import xyz.xenondevs.invui.gui.SlotElement.InventorySlotElement; -import xyz.xenondevs.invui.item.ItemProvider; import xyz.xenondevs.invui.inventory.Inventory; +import xyz.xenondevs.invui.item.ItemProvider; import java.util.function.Supplier; diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/Marker.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/Marker.java index 2b4dc2b..0568bb8 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/Marker.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/Marker.java @@ -2,7 +2,7 @@ package xyz.xenondevs.invui.gui.structure; /** * Used to mark slots in a {@link Structure} as special slots. - * + * * @see Markers */ public class Marker { diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/Structure.java b/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/Structure.java index b1df82a..181139c 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/Structure.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/gui/structure/Structure.java @@ -8,11 +8,11 @@ import org.jetbrains.annotations.Nullable; import xyz.xenondevs.invui.gui.Gui; import xyz.xenondevs.invui.gui.SlotElement; import xyz.xenondevs.invui.gui.SlotElement.ItemSlotElement; +import xyz.xenondevs.invui.inventory.Inventory; import xyz.xenondevs.invui.item.Item; import xyz.xenondevs.invui.item.ItemProvider; import xyz.xenondevs.invui.item.ItemWrapper; import xyz.xenondevs.invui.item.impl.SimpleItem; -import xyz.xenondevs.invui.inventory.Inventory; import java.util.HashMap; import java.util.function.Supplier; diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemPostUpdateEvent.java b/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemPostUpdateEvent.java index 3144c32..98ca76f 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemPostUpdateEvent.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemPostUpdateEvent.java @@ -14,12 +14,12 @@ public class ItemPostUpdateEvent extends ItemUpdateEvent { /** * Creates a new {@link ItemPreUpdateEvent}. * - * @param inventory The {@link Inventory} where this action takes place. - * @param updateReason The {@link UpdateReason} for the calling of this event. - * This will probably be a {@link PlayerUpdateReason} in most cases but can be a custom one - * if you called the methods in the {@link Inventory} yourself. - * if it wasn't a {@link Player} - * @param slot The slot that is affected + * @param inventory The {@link Inventory} where this action takes place. + * @param updateReason The {@link UpdateReason} for the calling of this event. + * This will probably be a {@link PlayerUpdateReason} in most cases but can be a custom one + * if you called the methods in the {@link Inventory} yourself. + * if it wasn't a {@link Player} + * @param slot The slot that is affected * @param previousItem The {@link ItemStack} that was on that slot previously * @param newItem The {@link ItemStack} that is on that slot now */ diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemPreUpdateEvent.java b/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemPreUpdateEvent.java index 204853f..6695bec 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemPreUpdateEvent.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemPreUpdateEvent.java @@ -16,12 +16,12 @@ public class ItemPreUpdateEvent extends ItemUpdateEvent { /** * Creates a new {@link ItemPreUpdateEvent}. * - * @param inventory The {@link Inventory} where this action takes place. - * @param updateReason The {@link UpdateReason} for the calling of this event. - * This will probably be a {@link PlayerUpdateReason} in most cases but can be a custom one - * if you called the methods in the {@link Inventory} yourself. - * if it wasn't a {@link Player} - * @param slot The slot that is affected + * @param inventory The {@link Inventory} where this action takes place. + * @param updateReason The {@link UpdateReason} for the calling of this event. + * This will probably be a {@link PlayerUpdateReason} in most cases but can be a custom one + * if you called the methods in the {@link Inventory} yourself. + * if it wasn't a {@link Player} + * @param slot The slot that is affected * @param previousItem The {@link ItemStack} that was there previously * @param newItem The {@link ItemStack} that will be there if the event isn't cancelled */ @@ -36,7 +36,7 @@ public class ItemPreUpdateEvent extends ItemUpdateEvent { * to a different one. * * @param newItem The {@link ItemStack} to appear in the {@link Inventory} - * if the {@link ItemPreUpdateEvent} is not cancelled. + * if the {@link ItemPreUpdateEvent} is not cancelled. */ public void setNewItem(@Nullable ItemStack newItem) { this.newItemStack = newItem; diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemUpdateEvent.java b/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemUpdateEvent.java index 998b820..429543a 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemUpdateEvent.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/inventory/event/ItemUpdateEvent.java @@ -17,12 +17,12 @@ abstract class ItemUpdateEvent { /** * Creates a new {@link ItemPreUpdateEvent}. * - * @param inventory The {@link Inventory} where this action takes place. - * @param updateReason The {@link UpdateReason} for the calling of this event. - * This will probably be a {@link PlayerUpdateReason} in most cases but can be a custom one - * if you called the methods in the {@link Inventory} yourself. - * if it wasn't a {@link Player} - * @param slot The slot that is affected + * @param inventory The {@link Inventory} where this action takes place. + * @param updateReason The {@link UpdateReason} for the calling of this event. + * This will probably be a {@link PlayerUpdateReason} in most cases but can be a custom one + * if you called the methods in the {@link Inventory} yourself. + * if it wasn't a {@link Player} + * @param slot The slot that is affected * @param previousItem The {@link ItemStack} that was there previously * @param newItem The {@link ItemStack} that will be there if the event isn't cancelled */ diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/util/ArrayUtils.java b/invui-core/src/main/java/xyz/xenondevs/invui/util/ArrayUtils.java index 88b2474..be575a0 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/util/ArrayUtils.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/util/ArrayUtils.java @@ -3,7 +3,10 @@ package xyz.xenondevs.invui.util; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.function.Predicate; public class ArrayUtils { diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/util/ItemUtils.java b/invui-core/src/main/java/xyz/xenondevs/invui/util/ItemUtils.java index 3ea9053..9ad3aa4 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/util/ItemUtils.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/util/ItemUtils.java @@ -20,6 +20,7 @@ public class ItemUtils { /** * Checks whether the given {@link ItemStack} is empty and returns null if it is. + * * @param itemStack The {@link ItemStack} to check. * @return The {@link ItemStack} if it is not empty or null otherwise. */ diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/window/AbstractSingleWindow.java b/invui-core/src/main/java/xyz/xenondevs/invui/window/AbstractSingleWindow.java index e6986c0..42d747d 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/window/AbstractSingleWindow.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/window/AbstractSingleWindow.java @@ -19,7 +19,6 @@ import xyz.xenondevs.invui.util.InventoryUtils; import xyz.xenondevs.invui.util.Pair; import java.util.Set; -import java.util.UUID; import java.util.function.Supplier; /** diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/window/AnvilWindow.java b/invui-core/src/main/java/xyz/xenondevs/invui/window/AnvilWindow.java index 5626d92..e5bfeee 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/window/AnvilWindow.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/window/AnvilWindow.java @@ -16,6 +16,7 @@ public interface AnvilWindow extends Window { /** * Creates a new {@link Builder.Single Window Builder} for a single {@link AnvilWindow}. + * * @return The new {@link Builder.Single Window Builder}. */ static @NotNull Builder.Single single() { @@ -24,6 +25,7 @@ public interface AnvilWindow extends Window { /** * Creates a new single {@link AnvilWindow} after configuring a {@link Builder.Single Window Builder} using the given {@link Consumer}. + * * @param consumer The {@link Consumer} to configure the {@link Builder.Single Window Builder}. * @return The created {@link AnvilWindow}. */ @@ -35,6 +37,7 @@ public interface AnvilWindow extends Window { /** * Creates a new {@link Builder.Split Window Builder} for a split {@link AnvilWindow}. + * * @return The new {@link Builder.Split Window Builder}. */ static @NotNull Builder.Split split() { @@ -43,6 +46,7 @@ public interface AnvilWindow extends Window { /** * Creates a new split {@link AnvilWindow} after configuring a {@link Builder.Split Window Builder} using the given {@link Consumer}. + * * @param consumer The {@link Consumer} to configure the {@link Builder.Split Window Builder}. * @return The created {@link AnvilWindow}. */ @@ -54,49 +58,52 @@ public interface AnvilWindow extends Window { /** * Gets the current rename text. + * * @return The current rename text. */ @Nullable String getRenameText(); /** * An {@link AnvilWindow} builder. + * * @param The builder type. - * * @see Window.Builder.Normal * @see CartographyWindow.Builder */ interface Builder> extends Window.Builder { - + /** * Sets the rename handlers of the {@link AnvilWindow}. + * * @param renameHandlers The new rename handlers. * @return The current builder. */ @Contract("_ -> this") @NotNull S setRenameHandlers(@NotNull List<@NotNull Consumer> renameHandlers); - + /** * Adds a rename handler to the {@link AnvilWindow}. + * * @param renameHandler The rename handler to add. * @return The current builder. */ @Contract("_ -> this") @NotNull S addRenameHandler(@NotNull Consumer renameHandler); - + /** * A single {@link AnvilWindow} builder. Combines both {@link AnvilWindow.Builder} and {@link Window.Builder.Single} * for an {@link AnvilWindow} with only one {@link Gui} that does not access the {@link Player Player's} inventory. - * + * * @see Window.Builder.Normal.Single * @see CartographyWindow.Builder.Single */ interface Single extends Builder, Window.Builder.Single {} - + /** * A split {@link AnvilWindow} builder. Combines both {@link AnvilWindow.Builder} and {@link Window.Builder.Double} * for an {@link AnvilWindow} with two {@link Gui Guis}, where the lower {@link Gui} is used to fill the * {@link Player Player's} inventory. - * + * * @see Window.Builder.Normal.Split * @see CartographyWindow.Builder.Split */ diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/window/CartographySingleWindowImpl.java b/invui-core/src/main/java/xyz/xenondevs/invui/window/CartographySingleWindowImpl.java index cd7a66d..597e222 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/window/CartographySingleWindowImpl.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/window/CartographySingleWindowImpl.java @@ -69,7 +69,7 @@ final class CartographySingleWindowImpl extends AbstractSingleWindow implements cartographyInventory.open(); } - public static final class BuilderImpl + public static final class BuilderImpl extends AbstractSingleWindow.AbstractBuilder implements CartographyWindow.Builder.Single { diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/window/NormalSingleWindowImpl.java b/invui-core/src/main/java/xyz/xenondevs/invui/window/NormalSingleWindowImpl.java index 5b3f1f7..e5032d7 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/window/NormalSingleWindowImpl.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/window/NormalSingleWindowImpl.java @@ -18,8 +18,8 @@ final class NormalSingleWindowImpl extends AbstractSingleWindow { super(player, title, gui, InventoryUtils.createMatchingInventory(gui, ""), closeable); } - public static final class BuilderImpl - extends AbstractSingleWindow.AbstractBuilder + public static final class BuilderImpl + extends AbstractSingleWindow.AbstractBuilder implements Window.Builder.Normal.Single { diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/window/Window.java b/invui-core/src/main/java/xyz/xenondevs/invui/window/Window.java index 8c35f76..401f004 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/window/Window.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/window/Window.java @@ -167,11 +167,11 @@ public interface Window { * Gets the contents of the {@link Window#getCurrentViewer() viewer's} inventory. * This method will always return the actual inventory contents and will not be affected by double windows placing * gui items in the {@link Player's} inventory. - * + * * @return The contents of the {@link Window#getCurrentViewer() viewer's} inventory, * or null if the {@link Window} {@link Window#isOpen() isn't open}. */ - @Nullable ItemStack @Nullable[] getPlayerItems(); + @Nullable ItemStack @Nullable [] getPlayerItems(); /** * Replaces the currently registered open handlers with the given list. diff --git a/invui-core/src/main/java/xyz/xenondevs/invui/window/WindowManager.java b/invui-core/src/main/java/xyz/xenondevs/invui/window/WindowManager.java index 282638b..06de271 100644 --- a/invui-core/src/main/java/xyz/xenondevs/invui/window/WindowManager.java +++ b/invui-core/src/main/java/xyz/xenondevs/invui/window/WindowManager.java @@ -17,7 +17,10 @@ import org.bukkit.inventory.Inventory; import org.jetbrains.annotations.Nullable; import xyz.xenondevs.invui.InvUI; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; /** * Manages all {@link Window Windows} and provides methods for searching them. @@ -98,6 +101,7 @@ public class WindowManager implements Listener { /** * Gets a set of all open {@link Window Windows}. + * * @deprecated Use {@link #getWindows()} instead */ @Deprecated