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,32 @@
package com.replaymod.render.blend.mixin;
import com.replaymod.render.blend.BlendState;
import com.replaymod.render.blend.exporters.TileEntityExporter;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.tileentity.TileEntity;
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(TileEntityRendererDispatcher.class)
public abstract class MixinTileEntityRendererDispatcher {
@Inject(method = "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntity;DDDFI)V",
at = @At("HEAD"))
public void preRender(TileEntity tileEntity, double x, double y, double z, float renderPartialTicks, int destroyStage, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(TileEntityExporter.class).preRender(tileEntity, x, y, z, renderPartialTicks, destroyStage);
}
}
@Inject(method = "renderTileEntityAt(Lnet/minecraft/tileentity/TileEntity;DDDFI)V",
at = @At("RETURN"))
public void postRender(TileEntity tileEntity, double x, double y, double z, float renderPartialTicks, int destroyStage, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(TileEntityExporter.class).postRender();
}
}
}