Add .blend export

This commit is contained in:
Jonas Herzig
2018-03-03 14:31:10 +01:00
parent 78ad02bc84
commit 6794b58524
41 changed files with 3180 additions and 17 deletions

View File

@@ -0,0 +1,46 @@
package com.replaymod.render.blend.mixin;
import com.replaymod.render.blend.BlendState;
import com.replaymod.render.blend.exporters.ParticlesExporter;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(EffectRenderer.class)
public abstract class MixinEffectRenderer {
@Inject(method = "renderParticles", at = @At("HEAD"))
public void preRender(Entity view, float renderPartialTicks, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(ParticlesExporter.class).preParticlesRender(false);
}
}
@Inject(method = "renderParticles", at = @At("RETURN"))
public void postRender(Entity view, float renderPartialTicks, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(ParticlesExporter.class).postParticlesRender();
}
}
@Inject(method = "renderLitParticles", at = @At("HEAD"))
public void preLitRender(Entity view, float renderPartialTicks, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(ParticlesExporter.class).preParticlesRender(true);
}
}
@Inject(method = "renderLitParticles", at = @At("RETURN"))
public void postLitRender(Entity view, float renderPartialTicks, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(ParticlesExporter.class).postParticlesRender();
}
}
}