From dbcd52fefd53fbb915cf55b512caf5d6ae6fc4e1 Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 18 Aug 2019 14:03:48 +0200 Subject: [PATCH] Add ShopPlayer#sendMessage for formatted messages --- .../de/epiceric/shopchest/api/player/ShopPlayer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/src/main/java/de/epiceric/shopchest/api/player/ShopPlayer.java b/api/src/main/java/de/epiceric/shopchest/api/player/ShopPlayer.java index 13c485a..98c28bb 100644 --- a/api/src/main/java/de/epiceric/shopchest/api/player/ShopPlayer.java +++ b/api/src/main/java/de/epiceric/shopchest/api/player/ShopPlayer.java @@ -23,6 +23,16 @@ public interface ShopPlayer { */ Player getPlayer(); + /** + * Sends a (formatted) message to this player + * + * @param message the message (a format string) + * @param args the arguments referenced by the format + */ + default void sendMessage(String message, Object... args) { + getPlayer().sendMessage(String.format(message, args)); + } + /** * Gets this player's flag *