Update blend export to 1.12.2

This commit is contained in:
Jonas Herzig
2018-03-03 18:40:52 +01:00
parent 6794b58524
commit 1bdf7da525
16 changed files with 407 additions and 102 deletions

View File

@@ -2,22 +2,33 @@ package com.replaymod.render.blend.mixin;
import com.replaymod.render.blend.BlendState;
import com.replaymod.render.blend.exporters.ItemExporter;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.item.ItemStack;
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>=10904
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.block.model.IBakedModel;
//#else
//$$ import net.minecraft.client.renderer.entity.RenderItem;
//$$ import net.minecraft.client.resources.model.IBakedModel;
//#endif
@Mixin(RenderItem.class)
public abstract class MixinRenderItem {
@Inject(method = "renderModel(Lnet/minecraft/client/resources/model/IBakedModel;Lnet/minecraft/item/ItemStack;)V",
//#if MC>=10904
@Inject(method = "renderModel(Lnet/minecraft/client/renderer/block/model/IBakedModel;Lnet/minecraft/item/ItemStack;)V",
at = @At("HEAD"))
//#else
//$$ @Inject(method = "renderModel(Lnet/minecraft/client/resources/model/IBakedModel;Lnet/minecraft/item/ItemStack;)V",
//$$ at = @At("HEAD"))
//#endif
private void onRenderModel(IBakedModel model, ItemStack stack, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(ItemExporter.class).onRender(model, stack);
blendState.get(ItemExporter.class).onRender((RenderItem)(Object)this, model, stack);
}
}
}