aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2022-02-13 07:52:10 +0200
committerSHsuperCM <shsupercm@gmail.com>2022-02-13 07:52:10 +0200
commit49318a4452f629274e96001700006e0b4a1464a5 (patch)
treee887cce1cec886e17247b2a99029e79b0255b0e7 /src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin
parent8823e77b989ab1035fa8813120177dd3a95ce863 (diff)
downloadCITResewn-49318a4452f629274e96001700006e0b4a1464a5.tar.gz
CITResewn-49318a4452f629274e96001700006e0b4a1464a5.tar.bz2
CITResewn-49318a4452f629274e96001700006e0b4a1464a5.zip
Moved some stuff around
Diffstat (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin/WeightCondition.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin/WeightCondition.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin/WeightCondition.java
new file mode 100644
index 0000000..ec0a5d7
--- /dev/null
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin/WeightCondition.java
@@ -0,0 +1,27 @@
+package shcm.shsupercm.fabric.citresewn.cit.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.cit.CITCondition;
+import shcm.shsupercm.fabric.citresewn.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) throws CITParsingException {
+ this.weight = parseInteger(value, properties);
+ }
+
+ @Override
+ public boolean test(CITContext context) {
+ return true;
+ }
+}