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 Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected int
protected boolean
protected @Nullable String
protected int
Fields inherited from class io.github.toberocat.guiengine.components.AbstractGuiComponentBuilder
clickFunctions, closeFunctions, dragFunctions, hidden, id, priority, x, y
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull EmbeddedGuiComponent
Create a new instance of the GUI component.void
deserialize
(@NotNull ParserContext node) Deserialize the properties of the GUI component from the provided ParserContext node.protected void
deserialize
(@NotNull ParserContext node, boolean forceTarget) setCopyAir
(boolean copyAir) Set whether to copy air slots from the embedded GUI or skip empty slots.setHeight
(int height) Set the height of the EmbeddedGuiComponent.setInteractions
(boolean interactions) Set whether to allow interactions with the embedded GUI or ignore interactions.setTargetGui
(@NotNull String targetGui) Set the ID of the target GUI to embed inside this component.setWidth
(int width) Set the width of the EmbeddedGuiComponent.Methods inherited from class io.github.toberocat.guiengine.components.AbstractGuiComponentBuilder
getId, self, setClickFunctions, setCloseFunctions, setDragFunctions, setHidden, setId, setPriority, setX, setY
-
Field Details
-
width
protected int width -
height
protected int height -
targetGui
-
copyAir
protected boolean copyAir -
interactions
protected boolean interactions
-
-
Constructor Details
-
EmbeddedGuiComponentBuilder
public EmbeddedGuiComponentBuilder()
-
-
Method Details
-
setWidth
Set the width of the EmbeddedGuiComponent.- Parameters:
width
- The width of the component.- Returns:
- The builder instance (for method chaining).
-
setHeight
Set the height of the EmbeddedGuiComponent.- Parameters:
height
- The height of the component.- Returns:
- The builder instance (for method chaining).
-
setTargetGui
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
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
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
Description copied from interface:GuiComponentBuilder
Create a new instance of the GUI component.- Returns:
- A new instance of the GUI component.
-
deserialize
Description copied from class:AbstractGuiComponentBuilder
Deserialize the properties of the GUI component from the provided ParserContext node.- Specified by:
deserialize
in interfaceGuiComponentBuilder
- Overrides:
deserialize
in classAbstractGuiComponentBuilder<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
-