Class Menu

java.lang.Object
com.marcusslover.plus.lib.item.Menu
All Implemented Interfaces:
ISendable<IMenu>, IMenu

public abstract class Menu extends Object implements IMenu
Represents a menu registry that holds all the menus. Each canvas is different and belongs to a player.
  • 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

      public void performUpdate(boolean force, @Nullable Menu.UpdateContext ctx)
      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

      public void performUpdate(UUID uuid, boolean force, @Nullable Menu.UpdateContext ctx)
      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, see performUpdate(boolean, UpdateContext).
      ctx - The context of the update.
    • send

      @NotNull public <T extends org.bukkit.command.CommandSender> @NotNull IMenu send(@NotNull T target)
      Specified by:
      send in interface ISendable<IMenu>
    • send

      @NotNull public @NotNull IMenu send(net.kyori.adventure.audience.Audience audience)
      Specified by:
      send in interface ISendable<IMenu>
    • 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.