Skip to content

Commit

Permalink
Exposing GUI title
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt committed Jan 12, 2022
1 parent 7a5fe4a commit c587490
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions core/src/main/java/dev/triumphteam/gui/guis/BaseGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit c587490

Please sign in to comment.