diff options
author | SHsuperCM <shsupercm@gmail.com> | 2022-03-06 17:42:04 +0200 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2022-03-06 17:42:04 +0200 |
commit | 2356c6bb055079ef03cfd26e9d505ab9cea3960d (patch) | |
tree | 4649c1ee2779b4997d1d386222e523d82786f45f /defaults/src | |
parent | 526a5f1da2354d328be10c4d6d2f58b3b73e0d20 (diff) | |
download | CITResewn-2356c6bb055079ef03cfd26e9d505ab9cea3960d.tar.gz CITResewn-2356c6bb055079ef03cfd26e9d505ab9cea3960d.tar.bz2 CITResewn-2356c6bb055079ef03cfd26e9d505ab9cea3960d.zip |
Modified global properties api a bit
Diffstat (limited to 'defaults/src')
-rw-r--r-- | defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java index a59e96c..0bd29e7 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/cit/types/TypeEnchantment.java @@ -23,6 +23,7 @@ import shcm.shsupercm.fabric.citresewn.pack.format.PropertyKey; import shcm.shsupercm.fabric.citresewn.pack.format.PropertyValue; import shcm.shsupercm.util.logic.Loops; +import javax.annotation.Nullable; import java.lang.ref.WeakReference; import java.util.*; import java.util.function.Consumer; @@ -152,21 +153,21 @@ public class TypeEnchantment extends CITType { } @Override - public void globalProperty(String key, PropertyValue value) throws Exception { + public void globalProperty(String key, @Nullable PropertyValue value) throws Exception { switch (key) { case "useGlint" -> { - globalUseGlint = Boolean.parseBoolean(value.value()); + globalUseGlint = value == null ? true : Boolean.parseBoolean(value.value()); if (!globalUseGlint && !"false".equalsIgnoreCase(value.value())) throw new Exception("Could not parse boolean"); } case "cap" -> { - globalCap = Integer.parseInt(value.value()); + globalCap = value == null ? Integer.MAX_VALUE : Integer.parseInt(value.value()); } case "method" -> { - globalMergeMethod = MergeMethodIntensity.MergeMethod.parse(value.value()); + globalMergeMethod = value == null ? MergeMethodIntensity.MergeMethod.AVERAGE : MergeMethodIntensity.MergeMethod.parse(value.value()); } case "fade" -> { - globalFade = Float.parseFloat(value.value()); + globalFade = value == null ? 0.5f : Float.parseFloat(value.value()); } } } @@ -182,11 +183,6 @@ public class TypeEnchantment extends CITType { loaded.clear(); loadedLayered.clear(); - - globalUseGlint = true; - globalCap = Integer.MAX_VALUE; - globalMergeMethod = MergeMethodIntensity.MergeMethod.AVERAGE; - globalFade = 0.5f; } public void apply() { |