diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITType.java | 7 | ||||
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/pack/PackParser.java | 4 |
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)); |