mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fix for single chance parsing
This commit is contained in:
parent
55d6217c32
commit
7d7414ebb9
@ -104,6 +104,15 @@ public final class BlockBucket implements ConfigurationSerializable {
|
|||||||
String[] blocksStr = string.split(",(?![^\\(\\[]*[\\]\\)])");
|
String[] blocksStr = string.split(",(?![^\\(\\[]*[\\]\\)])");
|
||||||
if (blocksStr.length == 1) {
|
if (blocksStr.length == 1) {
|
||||||
try {
|
try {
|
||||||
|
Matcher matcher = regex.matcher(string);
|
||||||
|
if (matcher.find()) {
|
||||||
|
String chanceStr = matcher.group("chance");
|
||||||
|
String block = matcher.group("block");
|
||||||
|
if (chanceStr != null && block != null && !MathMan.isInteger(block) && MathMan.isInteger(chanceStr)) {
|
||||||
|
String namespace = matcher.group("namespace");
|
||||||
|
string = (namespace == null ? "" : namespace + ":") + block;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.single = BlockUtil.get(string);
|
this.single = BlockUtil.get(string);
|
||||||
this.pattern = new BlockPattern(single);
|
this.pattern = new BlockPattern(single);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user