aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2022-02-13 07:20:35 +0200
committerSHsuperCM <shsupercm@gmail.com>2022-02-13 07:20:35 +0200
commita48789c45fb474a953df65e342a3bad27fd89870 (patch)
tree73c6b32f5dc8cf488afb606d789e73ce8f0a32aa /src
parent207048093b7727ff1dec581e6cb523a7a3086c59 (diff)
downloadCITResewn-a48789c45fb474a953df65e342a3bad27fd89870.tar.gz
CITResewn-a48789c45fb474a953df65e342a3bad27fd89870.tar.bz2
CITResewn-a48789c45fb474a953df65e342a3bad27fd89870.zip
Implemented items condition
Diffstat (limited to 'src')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java3
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/cit/CITCondition.java5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java b/src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java
index f258df4..4161a55 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java
@@ -10,7 +10,8 @@ import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue;
public class WeightCondition extends CITCondition {
@Entrypoint(CITConditionContainer.ENTRYPOINT)
- public static final CITConditionContainer<WeightCondition> CONTAINER = new CITConditionContainer<>(WeightCondition.class, WeightCondition::new, "weight");
+ public static final CITConditionContainer<WeightCondition> CONTAINER = new CITConditionContainer<>(WeightCondition.class, WeightCondition::new,
+ "weight");
public int weight = 0;
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cit/CITCondition.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cit/CITCondition.java
index b5aa315..c16d96a 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cit/CITCondition.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cit/CITCondition.java
@@ -1,5 +1,6 @@
package shcm.shsupercm.fabric.citresewn.pack.cit;
+import shcm.shsupercm.fabric.citresewn.CITResewn;
import shcm.shsupercm.fabric.citresewn.ex.CITParsingException;
import shcm.shsupercm.fabric.citresewn.pack.format.PropertyGroup;
import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue;
@@ -20,6 +21,10 @@ public abstract class CITCondition {
public abstract boolean test(CITContext context);
+ protected void warn(String message, PropertyValue value, PropertyGroup properties) {
+ CITResewn.logWarnLoading("Warning: " + CITParsingException.descriptionOf(message, properties, value.position()));
+ }
+
protected int parseInteger(PropertyValue value, PropertyGroup properties) throws CITParsingException {
try {
return Integer.parseInt(value.value());