SteamWar/SpigotCore
Archiviert
13
0

Add SWAnvilInv.defaultText

Dieser Commit ist enthalten in:
jojo 2021-01-22 16:27:18 +01:00
Ursprung 7562a307ff
Commit 3a26c30ae8

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) {