mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 13:05:41 +01:00
Split by regex
This commit is contained in:
parent
34eb7d05dc
commit
8c1985f9c0
@ -1320,7 +1320,7 @@ import java.util.zip.ZipInputStream;
|
|||||||
.filter(validArgument -> args.toLowerCase(Locale.ENGLISH).contains(validArgument))
|
.filter(validArgument -> args.toLowerCase(Locale.ENGLISH).contains(validArgument))
|
||||||
.count();
|
.count();
|
||||||
|
|
||||||
String[] split = args.toLowerCase(Locale.ENGLISH).split(",");
|
String[] split = args.toLowerCase(Locale.ENGLISH).split(",(?![^\\(\\[]*[\\]\\)])");
|
||||||
|
|
||||||
if (split.length > expected) {
|
if (split.length > expected) {
|
||||||
// This means we have multi-block block buckets
|
// This means we have multi-block block buckets
|
||||||
|
@ -66,7 +66,7 @@ public class Configuration {
|
|||||||
return new BlockBucket();
|
return new BlockBucket();
|
||||||
}
|
}
|
||||||
final BlockBucket blockBucket = new BlockBucket();
|
final BlockBucket blockBucket = new BlockBucket();
|
||||||
final String[] parts = string.split(",");
|
final String[] parts = string.split(",(?![^\\(\\[]*[\\]\\)])");
|
||||||
for (final String part : parts) {
|
for (final String part : parts) {
|
||||||
String block = part;
|
String block = part;
|
||||||
int chance = -1;
|
int chance = -1;
|
||||||
@ -99,7 +99,7 @@ public class Configuration {
|
|||||||
if (string == null || string.isEmpty()) {
|
if (string == null || string.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final String[] parts = string.split(",");
|
final String[] parts = string.split(",(?![^\\(\\[]*[\\]\\)])");
|
||||||
for (final String part : parts) {
|
for (final String part : parts) {
|
||||||
String block = part;
|
String block = part;
|
||||||
if (part.contains(":")) {
|
if (part.contains(":")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user