Skip to content

Commit 61c7bf1

Browse files
committed
Add TERRAIN_OPAQUE particles back
1 parent 225f54b commit 61c7bf1

File tree

8 files changed

+20
-7
lines changed

8 files changed

+20
-7
lines changed

build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ plugins {
44
id("fabric-loom") version("1.8.10") apply(false)
55
}
66

7-
val MINECRAFT_VERSION by extra { "1.21.4-pre2" }
7+
val MINECRAFT_VERSION by extra { "1.21.4-rc3" }
88
val NEOFORGE_VERSION by extra { "21.3.9-beta" }
99
val FABRIC_LOADER_VERSION by extra { "0.16.9" }
10-
val FABRIC_API_VERSION by extra { "0.109.0+1.21.4" }
10+
val FABRIC_API_VERSION by extra { "0.110.5+1.21.4" }
1111

1212
// This value can be set to null to disable Parchment.
1313
// TODO: Re-add Parchment

common/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dependencies {
5959

6060
modCompileOnly("net.fabricmc.fabric-api:fabric-renderer-api-v1:3.2.9+1172e897d7")
6161

62-
modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc1.21.4-pre3-local.jar")))
62+
modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc1.21.4-rc3-local.jar")))
6363
modCompileOnly("org.antlr:antlr4-runtime:4.13.1")
6464
modCompileOnly("io.github.douira:glsl-transformer:2.0.1")
6565
modCompileOnly("org.anarres:jcpp:1.4.14")

common/src/main/java/net/irisshaders/iris/fantastic/IrisParticleRenderTypes.java

+4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
import com.mojang.blaze3d.vertex.Tesselator;
77
import com.mojang.blaze3d.vertex.VertexFormat;
88
import net.minecraft.client.particle.ParticleRenderType;
9+
import net.minecraft.client.renderer.RenderType;
910
import net.minecraft.client.renderer.texture.TextureAtlas;
1011
import net.minecraft.client.renderer.texture.TextureManager;
1112

13+
import static net.minecraft.client.renderer.texture.TextureAtlas.LOCATION_BLOCKS;
14+
1215
public class IrisParticleRenderTypes {
1316

17+
public static final ParticleRenderType TERRAIN_OPAQUE = new ParticleRenderType("TERRAIN_OPAQUE", RenderType.opaqueParticle(LOCATION_BLOCKS));
1418
}

common/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinFireworkSparkParticle.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.irisshaders.iris.mixin.fantastic;
22

3+
import net.irisshaders.iris.fantastic.IrisParticleRenderTypes;
34
import net.minecraft.client.multiplayer.ClientLevel;
45
import net.minecraft.client.particle.ParticleRenderType;
56
import net.minecraft.client.particle.SimpleAnimatedParticle;
@@ -14,6 +15,6 @@ private MixinFireworkSparkParticle(ClientLevel level, double x, double y, double
1415

1516
@Override
1617
public ParticleRenderType getRenderType() {
17-
return ParticleRenderType.PARTICLE_SHEET_OPAQUE;
18+
return IrisParticleRenderTypes.TERRAIN_OPAQUE;
1819
}
1920
}

common/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinStationaryItemParticle.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.irisshaders.iris.mixin.fantastic;
22

3+
import net.irisshaders.iris.fantastic.IrisParticleRenderTypes;
34
import net.minecraft.client.multiplayer.ClientLevel;
45
import net.minecraft.client.particle.BlockMarker;
56
import net.minecraft.client.particle.ParticleRenderType;
@@ -30,7 +31,7 @@ public class MixinStationaryItemParticle {
3031
@Inject(method = "getRenderType", at = @At("HEAD"), cancellable = true)
3132
private void iris$overrideParticleRenderType(CallbackInfoReturnable<ParticleRenderType> cir) {
3233
if (isOpaque) {
33-
cir.setReturnValue(ParticleRenderType.TERRAIN_SHEET);
34+
cir.setReturnValue(IrisParticleRenderTypes.TERRAIN_OPAQUE);
3435
}
3536
}
3637
}

common/src/main/java/net/irisshaders/iris/mixin/fantastic/MixinTerrainParticle.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.irisshaders.iris.mixin.fantastic;
22

3+
import net.irisshaders.iris.fantastic.IrisParticleRenderTypes;
34
import net.minecraft.client.multiplayer.ClientLevel;
45
import net.minecraft.client.particle.ParticleRenderType;
56
import net.minecraft.client.particle.TerrainParticle;
@@ -31,7 +32,7 @@ public class MixinTerrainParticle {
3132
@Inject(method = "getRenderType", at = @At("HEAD"), cancellable = true)
3233
private void iris$overrideParticleSheet(CallbackInfoReturnable<ParticleRenderType> cir) {
3334
if (isOpaque) {
34-
cir.setReturnValue(ParticleRenderType.TERRAIN_SHEET);
35+
cir.setReturnValue(IrisParticleRenderTypes.TERRAIN_OPAQUE);
3536
}
3637
}
3738
}

fabric/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ dependencies {
6464
addRuntimeFabricModule("fabric-rendering-fluids-v1")
6565
addRuntimeFabricModule("fabric-resource-loader-v0")
6666

67-
modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc1.21.4-pre3-local.jar")))
67+
modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc1.21.4-rc3-local.jar")))
6868
implementAndInclude("org.antlr:antlr4-runtime:4.13.1")
6969
implementAndInclude("io.github.douira:glsl-transformer:2.0.1")
7070
implementAndInclude("org.anarres:jcpp:1.4.14")

fabric/src/main/java/net/irisshaders/iris/mixin/fabric/MixinParticleEngine.java

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.common.collect.ImmutableList;
44
import com.mojang.blaze3d.systems.RenderSystem;
55
import net.irisshaders.iris.api.v0.IrisApi;
6+
import net.irisshaders.iris.fantastic.IrisParticleRenderTypes;
67
import net.irisshaders.iris.fantastic.ParticleRenderingPhase;
78
import net.irisshaders.iris.fantastic.PhasedParticleEngine;
89
import net.irisshaders.iris.pipeline.programs.ShaderAccess;
@@ -14,6 +15,7 @@
1415
import net.minecraft.client.renderer.MultiBufferSource;
1516
import org.spongepowered.asm.mixin.Final;
1617
import org.spongepowered.asm.mixin.Mixin;
18+
import org.spongepowered.asm.mixin.Mutable;
1719
import org.spongepowered.asm.mixin.Shadow;
1820
import org.spongepowered.asm.mixin.Unique;
1921
import org.spongepowered.asm.mixin.injection.At;
@@ -54,15 +56,19 @@
5456
@Mixin(ParticleEngine.class)
5557
public class MixinParticleEngine implements PhasedParticleEngine {
5658
private static final List<ParticleRenderType> OPAQUE_PARTICLE_RENDER_TYPES;
59+
@Mutable
5760
@Shadow
5861
@Final
5962
private static List<ParticleRenderType> RENDER_ORDER;
6063

6164
static {
6265
OPAQUE_PARTICLE_RENDER_TYPES = ImmutableList.of(
6366
ParticleRenderType.PARTICLE_SHEET_OPAQUE,
67+
IrisParticleRenderTypes.TERRAIN_OPAQUE,
6468
ParticleRenderType.NO_RENDER
6569
);
70+
71+
RENDER_ORDER = List.of(ParticleRenderType.TERRAIN_SHEET, IrisParticleRenderTypes.TERRAIN_OPAQUE, ParticleRenderType.PARTICLE_SHEET_OPAQUE, ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT);
6672
}
6773

6874
@Unique

0 commit comments

Comments
 (0)