mirror of
https://github.com/filoghost/ChestCommands.git
synced 2024-11-26 20:16:16 +01:00
Configurable separator.
This commit is contained in:
parent
b9920a01d4
commit
2861cc2969
@ -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);
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user