Package com.marcusslover.plus.lib.item
Class Menu
java.lang.Object
com.marcusslover.plus.lib.item.Menu
Represents a menu registry that holds all the menus.
Each canvas is different and belongs to a player.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAllows you to perform an update on the menu.voidperformUpdate(boolean force, Menu.UpdateContext ctx) Allows you to perform an update on the menu.voidperformUpdate(UUID uuid, boolean force, Menu.UpdateContext ctx) Allows you to perform an update on the menu.@NotNull IMenusend(net.kyori.adventure.audience.Audience audience) @NotNull IMenusend(net.kyori.adventure.audience.Audience audience, boolean force, Menu.UpdateContext ctx) Sends the menu to the audience.<T extends org.bukkit.command.CommandSender>
@NotNull IMenusend(T target) <T extends org.bukkit.command.CommandSender>
@NotNull IMenusend(T target, boolean force, Menu.UpdateContext ctx) Sends the menu to the target.
-
Constructor Details
-
Menu
public Menu()
-
-
Method Details
-
performUpdate
public void performUpdate()Allows you to perform an update on the menu. All current menu viewers will have their menu updated. -
performUpdate
Allows you to perform an update on the menu. All current menu viewers will have their menu updated.- Parameters:
force- If the update should be forced. If true, the menu will be literally re-opened, if false, the menu will be updated. Setting it to false eliminates a lot of performance issues, however, if you are using a lot of dynamic elements outside item factories, you should set it to true.ctx- The context of the update.
-
performUpdate
Allows you to perform an update on the menu.- Parameters:
uuid- The player to update the menu for.force- If the update should be forced, seeperformUpdate(boolean, UpdateContext).ctx- The context of the update.
-
send
-
send
-
send
@NotNull public <T extends org.bukkit.command.CommandSender> @NotNull IMenu send(@NotNull T target, boolean force, @Nullable Menu.UpdateContext ctx) Sends the menu to the target.- Type Parameters:
T- The type of the target.- Parameters:
target- The target to send the menu to.force- If the menu should be forced.ctx- The context of the update.- Returns:
- The menu.
-
send
@NotNull public @NotNull IMenu send(net.kyori.adventure.audience.Audience audience, boolean force, @Nullable Menu.UpdateContext ctx) Sends the menu to the audience.- Parameters:
audience- The audience to send the menu to.force- If the menu should be forced.ctx- The context of the update.- Returns:
- The menu.
-