diff --git a/core/src/main/java/dev/triumphteam/gui/guis/BaseGui.java b/core/src/main/java/dev/triumphteam/gui/guis/BaseGui.java index bd77a02e..b37bcce1 100644 --- a/core/src/main/java/dev/triumphteam/gui/guis/BaseGui.java +++ b/core/src/main/java/dev/triumphteam/gui/guis/BaseGui.java @@ -28,6 +28,8 @@ import dev.triumphteam.gui.components.InteractionModifier; import dev.triumphteam.gui.components.exception.GuiException; import dev.triumphteam.gui.components.util.GuiFiller; +import dev.triumphteam.gui.components.util.Legacy; +import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; @@ -202,6 +204,27 @@ public BaseGui(@NotNull final GuiType guiType, @NotNull final String title) { guiItems = new LinkedHashMap<>(); } + /** + * Gets the GUI's title as string. + * + * @return The GUI's title. + */ + @NotNull + @Deprecated + public String getTitle() { + return title; + } + + /** + * Gets the GUI title as a {@link Component}. + * + * @return The GUI title {@link Component}. + */ + @NotNull + public Component title() { + return Legacy.SERIALIZER.deserialize(title); + } + /** * Sets the {@link GuiItem} to a specific slot on the GUI. *