Class EmbeddedGuiComponentBuilder<B extends EmbeddedGuiComponentBuilder<B>>

java.lang.Object
io.github.toberocat.guiengine.components.AbstractGuiComponentBuilder<B>
io.github.toberocat.guiengine.components.provided.embedded.EmbeddedGuiComponentBuilder<B>
Type Parameters:
B - The type of the builder, used for method chaining.
All Implemented Interfaces:
GuiComponentBuilder
Direct Known Subclasses:
PagedComponentBuilder

public class EmbeddedGuiComponentBuilder<B extends EmbeddedGuiComponentBuilder<B>> extends AbstractGuiComponentBuilder<B>
A builder class for creating EmbeddedGuiComponent instances. This builder provides methods for setting various properties of the EmbeddedGuiComponent.
  • Field Details

    • width

      protected int width
    • height

      protected int height
    • targetGui

      @Nullable protected @Nullable String targetGui
    • copyAir

      protected boolean copyAir
    • interactions

      protected boolean interactions
  • Constructor Details

    • EmbeddedGuiComponentBuilder

      public EmbeddedGuiComponentBuilder()
  • Method Details

    • setWidth

      @NotNull public B setWidth(int width)
      Set the width of the EmbeddedGuiComponent.
      Parameters:
      width - The width of the component.
      Returns:
      The builder instance (for method chaining).
    • setHeight

      @NotNull public B setHeight(int height)
      Set the height of the EmbeddedGuiComponent.
      Parameters:
      height - The height of the component.
      Returns:
      The builder instance (for method chaining).
    • setTargetGui

      @NotNull public B setTargetGui(@NotNull @NotNull String targetGui)
      Set the ID of the target GUI to embed inside this component.
      Parameters:
      targetGui - The ID of the target GUI to embed.
      Returns:
      The builder instance (for method chaining).
    • setCopyAir

      @NotNull public B setCopyAir(boolean copyAir)
      Set whether to copy air slots from the embedded GUI or skip empty slots.
      Parameters:
      copyAir - true to copy air slots, false to skip empty slots.
      Returns:
      The builder instance (for method chaining).
    • setInteractions

      @NotNull public B setInteractions(boolean interactions)
      Set whether to allow interactions with the embedded GUI or ignore interactions.
      Parameters:
      interactions - true to allow interactions, false to ignore interactions.
      Returns:
      The builder instance (for method chaining).
    • createComponent

      @NotNull public @NotNull EmbeddedGuiComponent createComponent()
      Description copied from interface: GuiComponentBuilder
      Create a new instance of the GUI component.
      Returns:
      A new instance of the GUI component.
    • deserialize

      public void deserialize(@NotNull @NotNull ParserContext node) throws IOException
      Description copied from class: AbstractGuiComponentBuilder
      Deserialize the properties of the GUI component from the provided ParserContext node.
      Specified by:
      deserialize in interface GuiComponentBuilder
      Overrides:
      deserialize in class AbstractGuiComponentBuilder<B extends EmbeddedGuiComponentBuilder<B>>
      Parameters:
      node - The ParserContext node containing the properties of the GUI component.
      Throws:
      IOException - If there is an error while deserializing the properties.
    • deserialize

      protected void deserialize(@NotNull @NotNull ParserContext node, boolean forceTarget) throws IOException
      Throws:
      IOException