aboutsummaryrefslogtreecommitdiff
path: root/defaults/src/main/java/shcm/shsupercm
diff options
context:
space:
mode:
Diffstat (limited to 'defaults/src/main/java/shcm/shsupercm')
-rw-r--r--defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionNBT.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionNBT.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionNBT.java
index 3157866..e382d6f 100644
--- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionNBT.java
+++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/conditions/ConditionNBT.java
@@ -108,10 +108,14 @@ public class ConditionNBT extends CITCondition {
} else {
if (element instanceof NbtCompound compound)
return testPath(compound.get(path), pathIndex + 1);
- else if (element instanceof NbtList list)
+ else if (element instanceof NbtList list) {
+ if (path.equals("count"))
+ return testValue(NbtInt.of(list.size()));
+
try {
return testPath(list.get(Integer.parseInt(path)), pathIndex + 1);
} catch (NumberFormatException | IndexOutOfBoundsException ignored) { }
+ }
}
return false;