aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java27
1 files changed, 27 insertions, 0 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
new file mode 100644
index 0000000..9882d7b
--- /dev/null
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/builtin/WeightCondition.java
@@ -0,0 +1,27 @@
+package shcm.shsupercm.fabric.citresewn.builtin;
+
+import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint;
+import shcm.shsupercm.fabric.citresewn.api.CITConditionContainer;
+import shcm.shsupercm.fabric.citresewn.ex.CITParsingException;
+import shcm.shsupercm.fabric.citresewn.pack.GlobalProperties;
+import shcm.shsupercm.fabric.citresewn.pack.cit.CITCondition;
+import shcm.shsupercm.fabric.citresewn.pack.cit.CITContext;
+import shcm.shsupercm.fabric.citresewn.pack.format.PropertyGroup;
+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 int weight = 0;
+
+ @Override
+ public void load(PropertyValue value, PropertyGroup properties, GlobalProperties globalProperties) throws CITParsingException {
+ this.weight = parseInteger(value, properties);
+ }
+
+ @Override
+ public boolean test(CITContext context) {
+ return true;
+ }
+}