From 355d4988f303477a97e7ece147aba7b4b88bd54d Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 22 Jan 2013 19:34:31 +1100 Subject: [PATCH] Fix alerts being cut off at start --- .../main/java/net/md_5/bungee/command/CommandAlert.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java b/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java index a584e300..82993b55 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java @@ -23,7 +23,11 @@ public class CommandAlert extends Command } else { StringBuilder builder = new StringBuilder(); - if (!args[0].startsWith("&h")) + if (args[0].startsWith("&h")) + { + // Remove &h + args[0] = args[0].substring(2, args[0].length()); + } else { builder.append(ChatColor.DARK_PURPLE); builder.append("[Alert] "); @@ -31,7 +35,6 @@ public class CommandAlert extends Command for (String s : args) { - s = s.substring(1, s.length()); builder.append(ChatColor.translateAlternateColorCodes('&', s)); builder.append(" "); }