SteamWar/SpigotCore
Archiviert
13
0

Merge pull request 'Add SWAnvilInv.defaultText' (#89) from SWAnvil into master

Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2021-01-22 16:29:28 +01:00
Commit d67a8657b3

Datei anzeigen

@ -32,11 +32,17 @@ public class SWAnvilInv {
private final AnvilGUI.Builder builder;
private final Player player;
private final String defaultText;
private Consumer<String> callback;
public SWAnvilInv(Player p, String t) {
builder = new AnvilGUI.Builder().plugin(Core.getInstance()).title(t).text("»").onComplete(this::onResult);
this(p, t, "");
}
public SWAnvilInv(Player p, String t, String defaultText) {
builder = new AnvilGUI.Builder().plugin(Core.getInstance()).title(t).text("»" + defaultText).onComplete(this::onResult);
this.defaultText = defaultText;
player = p;
}
@ -53,7 +59,7 @@ public class SWAnvilInv {
}
public void setItem(Material m, byte meta, List<String> lore, boolean e) {
builder.itemLeft(new SWItem(m, meta, "»", lore, e, null).getItemStack());
builder.itemLeft(new SWItem(m, meta, "»" + defaultText, lore, e, null).getItemStack());
}
public void setCallback(Consumer<String> callback) {