Configurable separator.

This commit is contained in:
filoghost 2014-11-08 09:07:21 +01:00
parent b9920a01d4
commit 2861cc2969
2 changed files with 7 additions and 1 deletions

View File

@ -9,6 +9,7 @@ public class Settings extends SpecialConfig {
public boolean use_console_colors = true; public boolean use_console_colors = true;
public String default_color__name = "&f"; public String default_color__name = "&f";
public String default_color__lore = "&7"; public String default_color__lore = "&7";
public String multiple_commands_separator = ";";
public Settings(PluginConfig config) { public Settings(PluginConfig config) {
super(config); super(config);

View File

@ -7,6 +7,7 @@ import java.util.Map.Entry;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.gmail.filoghost.chestcommands.ChestCommands;
import com.gmail.filoghost.chestcommands.internal.icon.IconCommand; import com.gmail.filoghost.chestcommands.internal.icon.IconCommand;
import com.gmail.filoghost.chestcommands.internal.icon.command.BroadcastIconCommand; import com.gmail.filoghost.chestcommands.internal.icon.command.BroadcastIconCommand;
import com.gmail.filoghost.chestcommands.internal.icon.command.ConsoleIconCommand; import com.gmail.filoghost.chestcommands.internal.icon.command.ConsoleIconCommand;
@ -57,8 +58,12 @@ public class CommandSerializer {
} }
public static List<IconCommand> readCommands(String input) { public static List<IconCommand> readCommands(String input) {
String separator = ChestCommands.getSettings().multiple_commands_separator;
if (separator == null || separator.length() == 0) {
separator = ";";
}
String[] split = input.split(";"); String[] split = input.split(Pattern.quote(separator));
List<IconCommand> iconCommands = Lists.newArrayList(); List<IconCommand> iconCommands = Lists.newArrayList();
for (String command : split) { for (String command : split) {