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 AddstarMC#10)
  • Loading branch information
addstar authored and Narimm committed Aug 17, 2015
1 parent a02dd00 commit 3ceb2fb
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 3ceb2fb

Please sign in to comment.