Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import com.llamalad7.mixinextras.sugar.Share;
import com.llamalad7.mixinextras.sugar.ref.LocalRef;
import com.mojang.blaze3d.systems.RenderSystem;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.client.Camera;
Expand All @@ -30,10 +32,12 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import xyz.bluspring.kilt.Kilt;
import xyz.bluspring.kilt.injections.client.particle.ParticleEngineInjection;

import java.util.*;
import java.util.function.Consumer;
import java.util.function.Predicate;

@Mixin(ParticleEngine.class)
public abstract class ParticleEngineInject implements ParticleEngineInjection {
Expand Down Expand Up @@ -75,6 +79,14 @@ public void render(LightTexture lightTexture, Camera camera, float tickDelta, @N
this.kilt$clippingHelper = null;
}

@Inject(method = "render", at = @At("HEAD"))
private void kilt$initShareData(LightTexture lightTexture, Camera camera, float partialTick, CallbackInfo ci,
@Share(value = "frustum", namespace = Kilt.MOD_ID) LocalRef<Frustum> frustum,
@Share(value = "renderTypePredicate", namespace = Kilt.MOD_ID) LocalRef<Predicate<ParticleRenderType>> renderTypePredicate) {
frustum.set(this.kilt$clippingHelper);
renderTypePredicate.set(type -> true); // Kilt TODO: our render() has the wrong signature
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableDepthTest()V", shift = At.Shift.AFTER, ordinal = 0, remap = false))
private void kilt$initActiveTexture(LightTexture lightTexture, Camera camera, float partialTick, CallbackInfo ci) {
RenderSystem.activeTexture(GL32C.GL_TEXTURE2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,23 @@ object KiltMixinModifications {
)
),

// Fixes Psi's ParticleEngineMixin
InjectedShareAccessModifier(
owner = "net/minecraft/client/particle/ParticleEngine",
methods = listOf("render(Lnet/minecraft/client/renderer/LightTexture;Lnet/minecraft/client/Camera;FLnet/minecraft/client/renderer/culling/Frustum;Ljava/util/function/Predicate;)V"),
paramToShareMapping = mapOf(
ParamPair("Lnet/minecraft/client/renderer/culling/Frustum;", 0) to Share("frustum", namespace = Kilt.MOD_ID),
ParamPair("Ljava/util/function/Predicate;", 0) to Share("renderTypePredicate", namespace = Kilt.MOD_ID),
)
),

// Goes along with the above
NameRemappingAnnotationModifier(
owner = "net/minecraft/client/particle/ParticleEngine",
methods = listOf("render(Lnet/minecraft/client/renderer/LightTexture;Lnet/minecraft/client/Camera;FLnet/minecraft/client/renderer/culling/Frustum;Ljava/util/function/Predicate;)V"),
remapMethodsTo = listOf("render(Lnet/minecraft/client/renderer/LightTexture;Lnet/minecraft/client/Camera;F)V")
),

// Fixes Lodestone's ShaderInstanceMixin
InjectedShareAccessModifier(
owner = "net/minecraft/client/renderer/ShaderInstance",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object KiltRemapper {
// Keeps track of the remapper changes, so every time I update the remapper,
// it remaps all the mods following the remapper changes.
// this can update by like 12 versions in 1 update, so don't worry too much about it.
const val REMAPPER_VERSION = 249
const val REMAPPER_VERSION = 250
const val MC_MAPPED_JAR_VERSION = 9

// Kilt JVM flags
Expand Down