From 70b04c19b5c6da9d63a095fb7a2e17fd722c9cb1 Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Wed, 23 Feb 2022 11:13:12 +0200 Subject: Ported more of the enchantment type --- .../shsupercm/fabric/citresewn/pack/format/PropertyGroup.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertyGroup.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertyGroup.java index 5252330..75949db 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertyGroup.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/format/PropertyGroup.java @@ -49,6 +49,14 @@ public abstract class PropertyGroup { return value; } + public PropertyValue getLastWithoutMetadataOrDefault(String defaultValue, String namespace, String... pathAliases) { + PropertyValue property = getLastWithoutMetadata(namespace, pathAliases); + if (property == null) + property = new PropertyValue(null, defaultValue, "=", -1, this.identifier, this.packName); + + return property; + } + public String stripName() { return identifier.getPath().substring(identifier.getPath().lastIndexOf('/') + 1, identifier.getPath().length() - getExtension().length()); } -- cgit