Skip to content

Commit

Permalink
fix: configurable gui titles is not colored.
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-cskn committed Jan 13, 2023
1 parent 5242592 commit 413b690
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import mc.obliviate.inventory.Icon;
import mc.obliviate.inventory.configurable.util.GuiSerializer;
import mc.obliviate.util.placeholder.PlaceholderUtil;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
Expand All @@ -30,7 +31,7 @@ public ConfigurableGui(@Nonnull Player player, @Nonnull String id) {
public ConfigurableGui(@Nonnull Player player, @Nonnull String id, @Nonnull GuiConfigurationTable guiConfigurationTable) {
super(player, id, "No title found", 0);
this.guiConfigurationTable = guiConfigurationTable;
setTitle(guiConfigurationTable.getMenusSection(getSectionPath()).getString(guiConfigurationTable.getTitleSectionName(), "No Title Found"));
setTitle(ChatColor.translateAlternateColorCodes('&', guiConfigurationTable.getMenusSection(getSectionPath()).getString(guiConfigurationTable.getTitleSectionName(), "No Title Found")));
setSize(guiConfigurationTable.getMenusSection(getSectionPath()).getInt(guiConfigurationTable.getSizeSectionName(), 0) * 9);
}

Expand Down Expand Up @@ -182,7 +183,7 @@ public void putIcon(@Nonnull String configName, @Nullable PlaceholderUtil placeh

/**
* Use {@link #addConfigIcon(String)} and {@link Icon#onClick(Consumer<InventoryClickEvent>)}<br>
*
* <p>
* Deprecated: {@code putIcon("any-icon", e -> {})}<br>
* Modern: {@code addConfigIcon("any-icon").onClick({})}
*/
Expand All @@ -193,7 +194,7 @@ public void putIcon(@Nonnull String configName, @Nonnull Consumer<InventoryClick

/**
* Use {@link #addConfigIcon(String, PlaceholderUtil)} and {@link Icon#onClick(Consumer<InventoryClickEvent>)}<br>
*
* <p>
* Deprecated: {@code putIcon("any-icon", placeholderUtil, e -> {})}<br>
* Modern: {@code addConfigIcon("any-icon", placeholderUtil).onClick({})}
*/
Expand Down

0 comments on commit 413b690

Please sign in to comment.