Apply rotation and scale to entity (livingbase), not its parts

Reduces amount of keyframes per entity and makes it easier to work with.
This commit is contained in:
Jonas Herzig
2019-03-14 11:30:40 +01:00
parent cd16e014d1
commit dc6de5bd5f
3 changed files with 45 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
//#if MC>=10800
package com.replaymod.render.blend.mixin;
import com.replaymod.render.blend.BlendState;
import com.replaymod.render.blend.exporters.EntityExporter;
import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.entity.EntityLivingBase;
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(RenderLivingBase.class)
public abstract class MixinRenderLivingBase {
@Inject(method = "doRender", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/entity/RenderLivingBase;prepareScale(Lnet/minecraft/entity/EntityLivingBase;F)F",
shift = At.Shift.AFTER
))
private void recordModelMatrix(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
BlendState blendState = BlendState.getState();
if (blendState != null) {
blendState.get(EntityExporter.class).postEntityLivingSetup();
}
}
}
//#endif