Update to MC 1.14 / Fabric

This commit is contained in:
Jonas Herzig
2019-05-04 14:37:00 +02:00
parent 17fe5b345f
commit 3d009e45c7
151 changed files with 3963 additions and 1455 deletions

View File

@@ -3,12 +3,17 @@ package com.replaymod.render.blend.mixin;
import com.replaymod.render.blend.BlendState;
import com.replaymod.render.blend.exporters.ParticlesExporter;
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;
//#if MC>=11400
//$$ import net.minecraft.client.render.Camera;
//#else
import net.minecraft.entity.Entity;
//#endif
//#if MC>=10904
import net.minecraft.client.particle.ParticleManager;
//#else
@@ -23,7 +28,15 @@ import net.minecraft.client.particle.ParticleManager;
public abstract class MixinEffectRenderer {
@Inject(method = "renderParticles", at = @At("HEAD"))
public void preRender(Entity view, float renderPartialTicks, CallbackInfo ci) {
private void preRender(
//#if MC>=11400
//$$ Camera view,
//#else
Entity view,
//#endif
float renderPartialTicks,
CallbackInfo ci
) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(ParticlesExporter.class).preParticlesRender(false);
@@ -31,13 +44,22 @@ public abstract class MixinEffectRenderer {
}
@Inject(method = "renderParticles", at = @At("RETURN"))
public void postRender(Entity view, float renderPartialTicks, CallbackInfo ci) {
private void postRender(
//#if MC>=11400
//$$ Camera view,
//#else
Entity view,
//#endif
float renderPartialTicks,
CallbackInfo ci
) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(ParticlesExporter.class).postParticlesRender();
}
}
//#if MC<11400
@Inject(method = "renderLitParticles", at = @At("HEAD"))
public void preLitRender(Entity view, float renderPartialTicks, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
@@ -53,5 +75,6 @@ public abstract class MixinEffectRenderer {
blendState.get(ParticlesExporter.class).postParticlesRender();
}
}
//#endif
}
//#endif