changed output method

This commit is contained in:
Indyuce 2019-09-01 17:21:07 +02:00
parent 376d475686
commit dbf3ee981a
3 changed files with 4 additions and 4 deletions

View File

@ -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());
}
}
}

View File

@ -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()));
}
}

View File

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