From 896724819041a0ca7552b405b007f17ee0d28f22 Mon Sep 17 00:00:00 2001 From: ryanhcode <42245712+ryanhcode@users.noreply.github.com> Date: Wed, 1 Jan 2025 17:13:37 -0500 Subject: [PATCH] Optimize imports and fix javadoc in pre-processor --- .../EffectiveTransparencyFixPreProcessor.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/java/org/ladysnake/effective/core/render/transformer/EffectiveTransparencyFixPreProcessor.java b/src/client/java/org/ladysnake/effective/core/render/transformer/EffectiveTransparencyFixPreProcessor.java index cd5d8d5..6f48ad7 100644 --- a/src/client/java/org/ladysnake/effective/core/render/transformer/EffectiveTransparencyFixPreProcessor.java +++ b/src/client/java/org/ladysnake/effective/core/render/transformer/EffectiveTransparencyFixPreProcessor.java @@ -1,18 +1,14 @@ package org.ladysnake.effective.core.render.transformer; import foundry.veil.api.client.render.shader.processor.ShaderPreProcessor; -import foundry.veil.api.glsl.GlslSyntaxException; import foundry.veil.api.glsl.node.GlslNode; import foundry.veil.api.glsl.node.GlslNodeList; import foundry.veil.api.glsl.node.GlslTree; import foundry.veil.api.glsl.node.branch.GlslSelectionNode; import foundry.veil.api.glsl.node.expression.GlslCompareNode; import foundry.veil.api.glsl.node.primary.GlslFloatConstantNode; -import foundry.veil.lib.anarres.cpp.LexerException; import net.minecraft.util.Identifier; -import java.io.IOException; - /** * A pre-processor intended to verify the Minecraft particle transparency check isn't active. *
@@ -28,8 +24,11 @@
* if (color.a < 0.0000001) {
* discard;
* }
+ * }
*
* Inside of any fragment shader named particle
.
+ *
+ * @author RyanHCode
*/
public class EffectiveTransparencyFixPreProcessor implements ShaderPreProcessor {
@@ -47,9 +46,7 @@ public void modify(final Context ctx, final GlslTree tree) {
assert mainFunctionBody != null : "Main function body is null";
for (final GlslNode node : mainFunctionBody) {
-
if (node instanceof GlslSelectionNode selectionNode && selectionNode.getExpression() instanceof GlslCompareNode compareNode) {
-
// We know there's an if statement (selectionNode) with a comparison inside it
// If the second part of the comparison is 0.1, and the comparison type is "less than", we can assume it's the transparency check