forked from Upstream/mmocore
changed output method
This commit is contained in:
parent
376d475686
commit
dbf3ee981a
@ -57,7 +57,7 @@ public class AnvilGUI extends PlayerInput {
|
||||
if (event.getRawSlot() == 2) {
|
||||
ItemStack clicked = inventory.getItem(event.getRawSlot());
|
||||
if (clicked != null && clicked.getType() != Material.AIR)
|
||||
getOutput().accept(clicked.hasItemMeta() ? clicked.getItemMeta().getDisplayName() : clicked.getType().toString());
|
||||
output(clicked.hasItemMeta() ? clicked.getItemMeta().getDisplayName() : clicked.getType().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class ChatInput extends PlayerInput {
|
||||
if (event.getPlayer().equals(getPlayer())) {
|
||||
close();
|
||||
event.setCancelled(true);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(MMOCore.plugin, () -> getOutput().accept(event.getMessage()));
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(MMOCore.plugin, () -> output(event.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@ public abstract class PlayerInput implements Listener {
|
||||
Bukkit.getPluginManager().registerEvents(this, MMOCore.plugin);
|
||||
}
|
||||
|
||||
public Consumer<String> getOutput() {
|
||||
return output;
|
||||
public void output(String input) {
|
||||
output.accept(input);
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
|
Loading…
Reference in New Issue
Block a user