Reformat code

This commit is contained in:
NichtStudioCode 2023-09-04 19:02:19 +02:00
parent de30faabd7
commit 66b9c33a42
21 changed files with 74 additions and 60 deletions

@ -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);

@ -134,7 +134,7 @@ public interface PagedGui<C> 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<C> 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) {

@ -25,7 +25,7 @@ final class PagedInventoriesGuiImpl extends AbstractPagedGui<Inventory> {
*
* @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<Inventory> {
/**
* 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);

@ -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;

@ -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;

@ -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;

@ -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;

@ -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
*/

@ -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;

@ -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
*/

@ -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 {

@ -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.
*/

@ -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;
/**

@ -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,14 +58,15 @@ public interface AnvilWindow extends Window {
/**
* Gets the current rename text.
*
* @return The current rename text.
*/
@Nullable String getRenameText();
/**
* An {@link AnvilWindow} builder.
* @param <S> The builder type.
*
* @param <S> The builder type.
* @see Window.Builder.Normal
* @see CartographyWindow.Builder
*/
@ -69,6 +74,7 @@ public interface AnvilWindow extends Window {
/**
* Sets the rename handlers of the {@link AnvilWindow}.
*
* @param renameHandlers The new rename handlers.
* @return The current builder.
*/
@ -77,6 +83,7 @@ public interface AnvilWindow extends Window {
/**
* Adds a rename handler to the {@link AnvilWindow}.
*
* @param renameHandler The rename handler to add.
* @return The current builder.
*/

@ -171,7 +171,7 @@ public interface Window {
* @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.

@ -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