From 2435eab96aa65480563e29b9184707fe81ca21bd Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 18 Oct 2014 10:22:08 -0700 Subject: [PATCH] sendMessage now supports console --- .classpath | 11 ++++++----- .../intellectualcrafters/plot/PlayerFunctions.java | 12 ++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.classpath b/.classpath index 147110327..5a1ee0116 100644 --- a/.classpath +++ b/.classpath @@ -6,10 +6,11 @@ - - - - - + + + + + + diff --git a/PlotSquared/src/com/intellectualcrafters/plot/PlayerFunctions.java b/PlotSquared/src/com/intellectualcrafters/plot/PlayerFunctions.java index 9c698735d..adf2650ca 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/PlayerFunctions.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/PlayerFunctions.java @@ -252,6 +252,12 @@ public class PlayerFunctions { if ((msg.length() == 0) || msg.equalsIgnoreCase("")) { return; } + + if (plr==null) { + PlotMain.sendConsoleSenderMessage(C.PREFIX.s() + msg); + return; + } + sendMessageWrapped(plr, ChatColor.translateAlternateColorCodes('&', C.PREFIX.s() + msg)); } @@ -264,6 +270,12 @@ public class PlayerFunctions { * Caption to send */ public static void sendMessage(Player plr, C c, String... args) { + + if (plr==null) { + PlotMain.sendConsoleSenderMessage(c); + return; + } + if (c.s().length() < 1) { return; }