From 7d7414ebb9f8dd159db5acd4f60a10a6bf0d52ed Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 11 Nov 2019 19:47:26 +0000 Subject: [PATCH] Fix for single chance parsing --- .../plotsquared/plot/object/BlockBucket.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java index a74c66317..c50fddbc3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java @@ -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;