From 1ed1d36671b7cfa4ef074196e7564d9827c83be4 Mon Sep 17 00:00:00 2001 From: IMS212 Date: Wed, 11 Dec 2024 08:41:00 -0800 Subject: [PATCH] Neo fixes --- build.gradle.kts | 2 +- .../java/net/irisshaders/iris/NeoLambdas.java | 6 ++-- neoforge/build.gradle.kts | 2 +- .../MixinLevelRenderer.java | 19 +----------- .../MixinParticleEngine.java | 30 ++++++++----------- .../src/main/resources/mixins.iris.forge.json | 2 ++ 6 files changed, 20 insertions(+), 41 deletions(-) rename neoforge/src/main/java/net/irisshaders/iris/mixin/{fantastic => forge}/MixinLevelRenderer.java (78%) rename neoforge/src/main/java/net/irisshaders/iris/mixin/{fantastic => forge}/MixinParticleEngine.java (76%) diff --git a/build.gradle.kts b/build.gradle.kts index 9072177865..36dcb6b346 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } val MINECRAFT_VERSION by extra { "1.21.4" } -val NEOFORGE_VERSION by extra { "21.4.0-beta" } +val NEOFORGE_VERSION by extra { "21.4.13-beta" } val FABRIC_LOADER_VERSION by extra { "0.16.9" } val FABRIC_API_VERSION by extra { "0.110.5+1.21.4" } diff --git a/common/src/main/java/net/irisshaders/iris/NeoLambdas.java b/common/src/main/java/net/irisshaders/iris/NeoLambdas.java index 1e7bf2c23b..5c885bb7f6 100644 --- a/common/src/main/java/net/irisshaders/iris/NeoLambdas.java +++ b/common/src/main/java/net/irisshaders/iris/NeoLambdas.java @@ -1,10 +1,10 @@ package net.irisshaders.iris; public class NeoLambdas { - public static final String NEO_RENDER_SKY = "lambda$addSkyPass$10"; + public static final String NEO_RENDER_SKY = "lambda$addSkyPass$12"; public static final String NEO_RENDER_MAIN_PASS = "lambda$addMainPass$2"; - public static final String NEO_RENDER_WEATHER = "lambda$addWeatherPass$5"; - public static final String NEO_RENDER_CLOUDS = "lambda$addCloudsPass$4"; + public static final String NEO_RENDER_WEATHER = "lambda$addWeatherPass$7"; + public static final String NEO_RENDER_CLOUDS = "lambda$addCloudsPass$6"; public static final String NEO_PARTICLE = "lambda$static$26"; public static final String NEO_WEATHER_TYPE = "lambda$createWeather$35"; } diff --git a/neoforge/build.gradle.kts b/neoforge/build.gradle.kts index 75c094d61e..efdf71590a 100644 --- a/neoforge/build.gradle.kts +++ b/neoforge/build.gradle.kts @@ -134,7 +134,7 @@ dependencies { runtimeOnly("org.sinytra.forgified-fabric-api:fabric-rendering-data-attachment-v1:0.3.48+73761d2e19") runtimeOnly("org.sinytra.forgified-fabric-api:fabric-block-view-api-v2:1.0.10+9afaaf8c19") - implementation("maven.modrinth", "sodium", "mc1.21.4-0.6.2-neoforge") + implementation("maven.modrinth", "sodium", "mc1.21.4-0.6.3-neoforge") includeAdditional("io.github.douira:glsl-transformer:2.0.1") includeAdditional("org.anarres:jcpp:1.4.14") includeAdditional("org.antlr:antlr4-runtime:4.13.1") diff --git a/neoforge/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinLevelRenderer.java b/neoforge/src/main/java/net/irisshaders/iris/mixin/forge/MixinLevelRenderer.java similarity index 78% rename from neoforge/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinLevelRenderer.java rename to neoforge/src/main/java/net/irisshaders/iris/mixin/forge/MixinLevelRenderer.java index bd70383ccf..f4cf63f0db 100644 --- a/neoforge/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinLevelRenderer.java +++ b/neoforge/src/main/java/net/irisshaders/iris/mixin/forge/MixinLevelRenderer.java @@ -1,35 +1,18 @@ -package net.irisshaders.iris.mixin.fantastic; +package net.irisshaders.iris.mixin.forge; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import net.irisshaders.iris.Iris; -import net.irisshaders.iris.fantastic.ParticleRenderingPhase; -import net.irisshaders.iris.fantastic.PhasedParticleEngine; import net.irisshaders.iris.pipeline.WorldRenderingPipeline; import net.irisshaders.iris.shaderpack.properties.ParticleRenderingSettings; import net.minecraft.client.Camera; -import net.minecraft.client.DeltaTracker; -import net.minecraft.client.Minecraft; import net.minecraft.client.particle.ParticleEngine; import net.minecraft.client.particle.ParticleRenderType; -import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.LevelRenderer; -import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.RenderBuffers; import net.minecraft.client.renderer.culling.Frustum; -import org.joml.Matrix4fStack; -import org.joml.Matrix4fc; -import org.joml.Matrix4f; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.function.Predicate; diff --git a/neoforge/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinParticleEngine.java b/neoforge/src/main/java/net/irisshaders/iris/mixin/forge/MixinParticleEngine.java similarity index 76% rename from neoforge/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinParticleEngine.java rename to neoforge/src/main/java/net/irisshaders/iris/mixin/forge/MixinParticleEngine.java index 50a55884e9..8473456119 100644 --- a/neoforge/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinParticleEngine.java +++ b/neoforge/src/main/java/net/irisshaders/iris/mixin/forge/MixinParticleEngine.java @@ -1,35 +1,19 @@ -package net.irisshaders.iris.mixin.fantastic; +package net.irisshaders.iris.mixin.forge; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Sets; -import com.mojang.blaze3d.systems.RenderSystem; -import net.irisshaders.iris.fantastic.ParticleRenderingPhase; -import net.irisshaders.iris.fantastic.PhasedParticleEngine; -import net.irisshaders.iris.pipeline.programs.ShaderAccess; +import net.irisshaders.iris.fantastic.IrisParticleRenderTypes; import net.minecraft.client.Camera; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleEngine; import net.minecraft.client.particle.ParticleRenderType; -import net.minecraft.client.renderer.LightTexture; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.culling.Frustum; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import javax.annotation.Nullable; -import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Queue; -import java.util.Set; -import java.util.function.Predicate; -import java.util.function.Supplier; /** * Extends the ParticleEngine class to allow multiple phases of particle rendering. @@ -64,4 +48,14 @@ public class MixinParticleEngine { // RenderSystem.setShader(ShaderAccess.getParticleTranslucentShader()); //} } + + @Redirect(method = "", at = @At(value = "INVOKE", target = "Ljava/util/List;of(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/List;")) + private static List iris$changeList(E e1, E e2, E e3) { + return (List) List.of(IrisParticleRenderTypes.TERRAIN_OPAQUE, e1, e2, e3); + } + + //@Inject(method = "renderParticleType(Lnet/minecraft/client/Camera;FLnet/minecraft/client/renderer/MultiBufferSource$BufferSource;Lnet/minecraft/client/particle/ParticleRenderType;Ljava/util/Queue;Lnet/minecraft/client/renderer/culling/Frustum;)V", at = @At("HEAD")) + private static void i(Camera p_382847_, float p_383032_, MultiBufferSource.BufferSource p_383105_, ParticleRenderType p_383179_, Queue p_383046_, Frustum frustum, CallbackInfo ci) { + System.out.println("Rendering particle " + p_383179_.name()); + } } diff --git a/neoforge/src/main/resources/mixins.iris.forge.json b/neoforge/src/main/resources/mixins.iris.forge.json index f92948198a..0bf870d4e9 100644 --- a/neoforge/src/main/resources/mixins.iris.forge.json +++ b/neoforge/src/main/resources/mixins.iris.forge.json @@ -7,6 +7,8 @@ "MixinItemBlockRenderTypes", "MixinRenderFlame", "MixinRenderMekasuit", + "MixinLevelRenderer", + "MixinParticleEngine", "MixinRenderSPS", "MixinShadowRenderer", "MixinVBOIE"