Build Chat API over Adventure instead of Bungeecord-chat

This commit is contained in:
2021-07-09 00:27:59 +02:00
parent 80cc70a570
commit 304faa072e
10 changed files with 240 additions and 131 deletions

View File

@@ -34,9 +34,17 @@ public class GUIInventory implements Listener {
private boolean isOpened = false;
private Map<Integer, Callback<InventoryClickEvent>> onClickEvents;
@Deprecated
public GUIInventory(Player p, int nbLines, String title, Callback<InventoryCloseEvent> closeEventAction,
Plugin pl) {
inv = Bukkit.createInventory(null, nbLines * 9, title);
this(p, nbLines, title == null ? null : Chat.legacyText(title), closeEventAction, pl);
}
public GUIInventory(Player p, int nbLines, Chat title, Callback<InventoryCloseEvent> closeEventAction,
Plugin pl) {
if (title == null)
inv = Bukkit.createInventory(null, nbLines * 9);
else
inv = Bukkit.createInventory(null, nbLines * 9, title.getAdv());
setCloseEvent(closeEventAction);