From 17c404dfa150ace6cf3d8a99c981a5bb2935a258 Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Sat, 16 Oct 2021 16:31:41 +0300 Subject: Added blur effect to enchantment --- .../shsupercm/fabric/citresewn/pack/cits/CITEnchantment.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/shcm') 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 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; -- cgit