mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-02-11 11:40:41 +00:00
Fix for single chance parsing
This commit is contained in:
parent
55d6217c32
commit
7d7414ebb9
1 changed files with 9 additions and 0 deletions
|
@ -104,6 +104,15 @@ public final class BlockBucket implements ConfigurationSerializable {
|
|||
String[] blocksStr = string.split(",(?![^\\(\\[]*[\\]\\)])");
|
||||
if (blocksStr.length == 1) {
|
||||
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.pattern = new BlockPattern(single);
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue