9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-29 11:59:21 +00:00

Fixed title PAPI placeholder

This commit is contained in:
HeroBrineGoat
2022-01-16 15:52:05 -05:00
parent 66ff99e657
commit 32afd0d144
5 changed files with 7 additions and 6 deletions

View File

@@ -89,7 +89,7 @@ public class DyeGuiSerializer implements TypeSerializer<DyeSelectorGui> {
return new DyeSelectorGui(
plugin,
Adventure.SERIALIZER.serialize(
Adventure.MINI_MESSAGE.parse(StringUtils.applyPapiPlaceholders(null, title))),
Adventure.MINI_MESSAGE.parse(title)),
rowsNode.getInt(),
guiItemMap);
}

View File

@@ -68,7 +68,7 @@ public class GuiSerializer implements TypeSerializer<CosmeticGui> {
return new CosmeticGui(plugin,
Adventure.SERIALIZER.serialize(
Adventure.MINI_MESSAGE.parse(StringUtils.applyPapiPlaceholders(null, title))),
Adventure.MINI_MESSAGE.parse(title)),
rowsNode.getInt(),
guiItemMap);
}

View File

@@ -10,6 +10,7 @@ import io.github.fisher2911.hmccosmetics.message.MessageHandler;
import io.github.fisher2911.hmccosmetics.message.Messages;
import io.github.fisher2911.hmccosmetics.message.Placeholder;
import io.github.fisher2911.hmccosmetics.user.User;
import io.github.fisher2911.hmccosmetics.util.StringUtils;
import io.github.fisher2911.hmccosmetics.util.builder.ItemBuilder;
import org.bukkit.Bukkit;
import org.bukkit.entity.HumanEntity;
@@ -165,7 +166,7 @@ public class CosmeticGui {
final User user = optionalUser.get();
this.gui = Gui.gui().
title(Adventure.MINI_MESSAGE.parse(this.title)).
title(Adventure.MINI_MESSAGE.parse(StringUtils.applyPapiPlaceholders(user.getPlayer(), this.title))).
rows(this.rows).
create();

View File

@@ -5,6 +5,7 @@ import dev.triumphteam.gui.guis.GuiItem;
import io.github.fisher2911.hmccosmetics.HMCCosmetics;
import io.github.fisher2911.hmccosmetics.inventory.PlayerArmor;
import io.github.fisher2911.hmccosmetics.user.User;
import io.github.fisher2911.hmccosmetics.util.StringUtils;
import io.github.fisher2911.hmccosmetics.util.builder.ColorBuilder;
import io.github.fisher2911.hmccosmetics.util.builder.ItemBuilder;
import net.kyori.adventure.text.Component;
@@ -30,7 +31,7 @@ public class DyeSelectorGui extends CosmeticGui {
public Gui getGui(final User user, final ArmorItem armorItem) {
final Gui gui = Gui.gui().
title(Component.text(this.title)).
title(Component.text(StringUtils.applyPapiPlaceholders(user.getPlayer(), this.title))).
rows(rows).
create();