diff --git a/api/src/main/java/ru/dragonestia/msb3/api/ui/PictureBanner.java b/api/src/main/java/ru/dragonestia/msb3/api/ui/PictureBanner.java index b6ba30e..1027fe6 100644 --- a/api/src/main/java/ru/dragonestia/msb3/api/ui/PictureBanner.java +++ b/api/src/main/java/ru/dragonestia/msb3/api/ui/PictureBanner.java @@ -1,11 +1,11 @@ package ru.dragonestia.msb3.api.ui; import net.kyori.adventure.key.Key; +import net.kyori.adventure.text.TextComponent; import net.minestom.server.entity.Player; import net.minestom.server.inventory.Inventory; import net.minestom.server.inventory.InventoryType; import ru.dragonestia.msb3.api.resource.dialog.GlyphPositions; -import ru.dragonestia.msb3.api.util.ResourceFromJar; import ru.dragonestia.msb3.resource.Resources; import ru.dragonestia.msb3.resource.glyph.GlyphComponentBuilder; import ru.dragonestia.msb3.resource.glyph.GlyphImage; @@ -72,14 +72,17 @@ public class PictureBanner { ); } - public void show(Player player) { + public TextComponent render() { var builder = new GlyphComponentBuilder(); builder.append(CHEST_GUI_WIDTH / 2 + 2 - glyph1.width(), glyph1); builder.append(CHEST_GUI_WIDTH / 2 + 1, glyph2); builder.append(CHEST_GUI_WIDTH / 2 + 2 - glyph3.width(), glyph3); builder.append(CHEST_GUI_WIDTH / 2 + 1, glyph4); + return builder.build(); + } - var inv = new Inventory(InventoryType.CHEST_6_ROW, builder.build()); + public void show(Player player) { + var inv = new Inventory(InventoryType.CHEST_6_ROW, render()); player.openInventory(inv); } } diff --git a/api/src/main/resources/glyphs/test_banner.png b/api/src/main/resources/glyphs/test_banner.png new file mode 100644 index 0000000..ef56a1f Binary files /dev/null and b/api/src/main/resources/glyphs/test_banner.png differ