Merge pull request 'Add SWAnvilInv.defaultText' (#89) from SWAnvil into master
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
d67a8657b3
@ -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) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren