Skip to content

Commit

Permalink
Add TERRAIN_OPAQUE particles back
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Dec 3, 2024
1 parent 225f54b commit 61c7bf1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ plugins {
id("fabric-loom") version("1.8.10") apply(false)
}

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

// This value can be set to null to disable Parchment.
// TODO: Re-add Parchment
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies {

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

modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc1.21.4-pre3-local.jar")))
modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc1.21.4-rc3-local.jar")))
modCompileOnly("org.antlr:antlr4-runtime:4.13.1")
modCompileOnly("io.github.douira:glsl-transformer:2.0.1")
modCompileOnly("org.anarres:jcpp:1.4.14")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.particle.ParticleRenderType;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.texture.TextureAtlas;
import net.minecraft.client.renderer.texture.TextureManager;

import static net.minecraft.client.renderer.texture.TextureAtlas.LOCATION_BLOCKS;

public class IrisParticleRenderTypes {

public static final ParticleRenderType TERRAIN_OPAQUE = new ParticleRenderType("TERRAIN_OPAQUE", RenderType.opaqueParticle(LOCATION_BLOCKS));
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.irisshaders.iris.mixin.fantastic;

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

@Override
public ParticleRenderType getRenderType() {
return ParticleRenderType.PARTICLE_SHEET_OPAQUE;
return IrisParticleRenderTypes.TERRAIN_OPAQUE;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.irisshaders.iris.mixin.fantastic;

import net.irisshaders.iris.fantastic.IrisParticleRenderTypes;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.BlockMarker;
import net.minecraft.client.particle.ParticleRenderType;
Expand Down Expand Up @@ -30,7 +31,7 @@ public class MixinStationaryItemParticle {
@Inject(method = "getRenderType", at = @At("HEAD"), cancellable = true)
private void iris$overrideParticleRenderType(CallbackInfoReturnable<ParticleRenderType> cir) {
if (isOpaque) {
cir.setReturnValue(ParticleRenderType.TERRAIN_SHEET);
cir.setReturnValue(IrisParticleRenderTypes.TERRAIN_OPAQUE);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.irisshaders.iris.mixin.fantastic;

import net.irisshaders.iris.fantastic.IrisParticleRenderTypes;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.particle.ParticleRenderType;
import net.minecraft.client.particle.TerrainParticle;
Expand Down Expand Up @@ -31,7 +32,7 @@ public class MixinTerrainParticle {
@Inject(method = "getRenderType", at = @At("HEAD"), cancellable = true)
private void iris$overrideParticleSheet(CallbackInfoReturnable<ParticleRenderType> cir) {
if (isOpaque) {
cir.setReturnValue(ParticleRenderType.TERRAIN_SHEET);
cir.setReturnValue(IrisParticleRenderTypes.TERRAIN_OPAQUE);
}
}
}
2 changes: 1 addition & 1 deletion fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
addRuntimeFabricModule("fabric-rendering-fluids-v1")
addRuntimeFabricModule("fabric-resource-loader-v0")

modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc1.21.4-pre3-local.jar")))
modImplementation(files(rootDir.resolve("custom_sodium").resolve("sodium-fabric-0.6.0-snapshot+mc1.21.4-rc3-local.jar")))
implementAndInclude("org.antlr:antlr4-runtime:4.13.1")
implementAndInclude("io.github.douira:glsl-transformer:2.0.1")
implementAndInclude("org.anarres:jcpp:1.4.14")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.systems.RenderSystem;
import net.irisshaders.iris.api.v0.IrisApi;
import net.irisshaders.iris.fantastic.IrisParticleRenderTypes;
import net.irisshaders.iris.fantastic.ParticleRenderingPhase;
import net.irisshaders.iris.fantastic.PhasedParticleEngine;
import net.irisshaders.iris.pipeline.programs.ShaderAccess;
Expand All @@ -14,6 +15,7 @@
import net.minecraft.client.renderer.MultiBufferSource;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -54,15 +56,19 @@
@Mixin(ParticleEngine.class)
public class MixinParticleEngine implements PhasedParticleEngine {
private static final List<ParticleRenderType> OPAQUE_PARTICLE_RENDER_TYPES;
@Mutable
@Shadow
@Final
private static List<ParticleRenderType> RENDER_ORDER;

static {
OPAQUE_PARTICLE_RENDER_TYPES = ImmutableList.of(
ParticleRenderType.PARTICLE_SHEET_OPAQUE,
IrisParticleRenderTypes.TERRAIN_OPAQUE,
ParticleRenderType.NO_RENDER
);

RENDER_ORDER = List.of(ParticleRenderType.TERRAIN_SHEET, IrisParticleRenderTypes.TERRAIN_OPAQUE, ParticleRenderType.PARTICLE_SHEET_OPAQUE, ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT);
}

@Unique
Expand Down

0 comments on commit 61c7bf1

Please sign in to comment.