refactor: updated banners

This commit is contained in:
Andrey Terentev 2025-03-09 20:24:26 +07:00
parent f59736deef
commit 1d8387403f
2 changed files with 6 additions and 3 deletions

View File

@ -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);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB