diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java | 5 | ||||
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin/AlwaysFailCondition.java | 19 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java index fb0f793..af8f430 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/CITRegistry.java @@ -4,6 +4,7 @@ import net.fabricmc.loader.api.FabricLoader; import net.minecraft.util.Identifier; import shcm.shsupercm.fabric.citresewn.api.CITConditionContainer; import shcm.shsupercm.fabric.citresewn.api.CITTypeContainer; +import shcm.shsupercm.fabric.citresewn.cit.builtin.AlwaysFailCondition; import shcm.shsupercm.fabric.citresewn.ex.CITParsingException; import shcm.shsupercm.fabric.citresewn.ex.UnknownCITTypeException; import shcm.shsupercm.fabric.citresewn.pack.format.PropertyGroup; @@ -43,8 +44,8 @@ public class CITRegistry { public static CITCondition parseCondition(PropertyKey key, PropertyValue value, PropertyGroup properties) throws CITParsingException { CITConditionContainer<? extends CITCondition> conditionContainer = CONDITIONS.get(key); if (conditionContainer == null) { - logWarnLoading("Skipping condition: " + CITParsingException.descriptionOf("Unknown condition type", properties, value.position())); - return null; + logWarnLoading(CITParsingException.descriptionOf("Unknown condition type", properties, value.position())); + return new AlwaysFailCondition(); } CITCondition condition = conditionContainer.createCondition.get(); diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin/AlwaysFailCondition.java b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin/AlwaysFailCondition.java new file mode 100644 index 0000000..f385ae9 --- /dev/null +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/cit/builtin/AlwaysFailCondition.java @@ -0,0 +1,19 @@ +package shcm.shsupercm.fabric.citresewn.cit.builtin; + +import shcm.shsupercm.fabric.citresewn.cit.CITCondition; +import shcm.shsupercm.fabric.citresewn.cit.CITContext; +import shcm.shsupercm.fabric.citresewn.ex.CITParsingException; +import shcm.shsupercm.fabric.citresewn.pack.format.PropertyGroup; +import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue; + +public class AlwaysFailCondition extends CITCondition { + @Override + public void load(PropertyValue value, PropertyGroup properties) throws CITParsingException { + + } + + @Override + public boolean test(CITContext context) { + return false; + } +} |