Skip to content

Commit

Permalink
Allow any message to be disabled by setting it to an empty string (Re…
Browse files Browse the repository at this point in the history
…solves #10)
  • Loading branch information
addstar committed Dec 15, 2014
1 parent 547f8e6 commit 0e6aba6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/net/cubespace/geSuit/objects/GSPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public ProxiedPlayer getProxiedPlayer()

public void sendMessage(String message)
{
// Allow messages to be "silenced" by providing an empty string
// (if you really must send a blank line for some reason, use a formatting code on its own, eg. "&f")
if (message == null || message.isEmpty())
return;

for (String line : message.split("\n|\\{N\\}")) {
getProxiedPlayer().sendMessage(TextComponent.fromLegacyText(Utilities.colorize(line)));
}
Expand Down

0 comments on commit 0e6aba6

Please sign in to comment.