diff options
author | SHsuperCM <shsupercm@gmail.com> | 2021-10-16 16:31:41 +0300 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2021-10-16 16:31:41 +0300 |
commit | 17c404dfa150ace6cf3d8a99c981a5bb2935a258 (patch) | |
tree | f91937b53dd81bd281d5fdfaa4e6dd18bdebeb6e /src/main/java | |
parent | 4ba7596ba4a6d4b5e809a25e78acd0b9faabd22f (diff) | |
download | CITResewn-17c404dfa150ace6cf3d8a99c981a5bb2935a258.tar.gz CITResewn-17c404dfa150ace6cf3d8a99c981a5bb2935a258.tar.bz2 CITResewn-17c404dfa150ace6cf3d8a99c981a5bb2935a258.zip |
Added blur effect to enchantment
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java index 09fbb90..6dc7a5a 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java @@ -26,7 +26,7 @@ public class CITEnchantment extends CIT { public final Identifier textureIdentifier; public final float speed, rotation, duration; public final int layer; - public final boolean useGlint; + public final boolean useGlint, blur; public final Blend blend; public final Map<GlintRenderLayer, RenderLayer> renderLayers = new EnumMap<>(GlintRenderLayer.class); @@ -52,6 +52,12 @@ public class CITEnchantment extends CIT { default -> throw new Exception("useGlint is not a boolean"); }; + blur = switch (properties.getProperty("blur", "true").toLowerCase(Locale.ENGLISH)) { + case "true" -> true; + case "false" -> false; + default -> throw new Exception("blur is not a boolean"); + }; + blend = Blend.valueOf(properties.getProperty("blend", "add").toUpperCase(Locale.ENGLISH)); } catch (Exception e) { throw new CITParseException(pack.resourcePack, identifier, (e.getClass() == Exception.class ? "" : e.getClass().getSimpleName() + ": ") + e.getMessage()); @@ -148,7 +154,7 @@ public class CITEnchantment extends CIT { final float speed = enchantment.speed, rotation = enchantment.rotation; //noinspection ConstantConditions RenderLayer.MultiPhaseParameters.Builder layer = RenderLayer.MultiPhaseParameters.builder() - .texture(new RenderPhase.Texture(enchantment.textureIdentifier, false, false)) + .texture(new RenderPhase.Texture(enchantment.textureIdentifier, enchantment.blur, false)) .texturing(new RenderPhase.Texturing("citresewn_glint_texturing", () -> { float l = Util.getMeasuringTimeMs() * CITResewnConfig.INSTANCE().citenchantment_scroll_multiplier * speed; float x = (l % 110000f) / 110000f; |