aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/shcm
diff options
context:
space:
mode:
authorSHsuperCM <shsupercm@gmail.com>2022-02-16 14:42:15 +0200
committerSHsuperCM <shsupercm@gmail.com>2022-02-16 14:42:15 +0200
commit185dd9defbd5e0a511a6551e7857b01c5353dd5b (patch)
treeb91c092bd19427eab3759d200db601f2d4f824d2 /src/main/java/shcm
parent2bda2f19a107f5a31e62b7c60e95035fcea3448e (diff)
downloadCITResewn-185dd9defbd5e0a511a6551e7857b01c5353dd5b.tar.gz
CITResewn-185dd9defbd5e0a511a6551e7857b01c5353dd5b.tar.bz2
CITResewn-185dd9defbd5e0a511a6551e7857b01c5353dd5b.zip
Implemented type-specific property acknowledgement
Diffstat (limited to 'src/main/java/shcm')
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java7
-rw-r--r--src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java
index 3618dfd..aed784a 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java
@@ -5,13 +5,14 @@ import net.minecraft.util.Identifier;
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.PropertyKey;
import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue;
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
+import java.util.*;
public abstract class CITType {
+ public abstract Set<PropertyKey> typeProperties();
+
public abstract void load(List<? extends CITCondition> conditions, PropertyGroup properties, ResourceManager resourceManager) throws CITParsingException;
protected void warn(String message, PropertyValue value, PropertyGroup properties) {
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
index 38ca718..70e3f75 100644
--- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
+++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java
@@ -82,9 +82,13 @@ public class PackParser {
ArrayList<CITCondition> conditions = new ArrayList<>();
+ Set<PropertyKey> ignoredProperties = citType.typeProperties();
+
for (Map.Entry<PropertyKey, Set<PropertyValue>> entry : properties.properties.entrySet()) {
if (entry.getKey().path().equals("type") && entry.getKey().namespace().equals("citresewn"))
continue;
+ if (ignoredProperties.contains(entry.getKey()))
+ continue;
for (PropertyValue value : entry.getValue())
conditions.add(CITRegistry.parseCondition(entry.getKey(), value, properties));