Move MixinEntityRenderer into 1.7.10 project
This commit is contained in:
@@ -1,28 +1 @@
|
|||||||
//#if MC<10800
|
// 1.7.10 and below
|
||||||
//$$ package com.replaymod.replay.mixin;
|
|
||||||
//$$
|
|
||||||
//$$ import com.replaymod.replay.camera.CameraEntity;
|
|
||||||
//$$ import net.minecraft.client.Minecraft;
|
|
||||||
//$$ import net.minecraft.client.renderer.EntityRenderer;
|
|
||||||
//$$ import net.minecraft.entity.EntityLivingBase;
|
|
||||||
//$$ import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
//$$ import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
//$$ import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
//$$ import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
//$$ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
//$$
|
|
||||||
//$$ @Mixin(EntityRenderer.class)
|
|
||||||
//$$ public class MixinEntityRenderer {
|
|
||||||
//$$ @Shadow private float prevCamRoll;
|
|
||||||
//$$ @Shadow private float camRoll;
|
|
||||||
//$$ @Shadow private Minecraft mc;
|
|
||||||
//$$
|
|
||||||
//$$ @Inject(method = "orientCamera", at = @At("HEAD"))
|
|
||||||
//$$ private void applyRoll(float partialTicks, CallbackInfo ci) {
|
|
||||||
//$$ EntityLivingBase view = mc.renderViewEntity;
|
|
||||||
//$$ if (view instanceof CameraEntity) {
|
|
||||||
//$$ prevCamRoll = camRoll = ((CameraEntity) view).roll;
|
|
||||||
//$$ }
|
|
||||||
//$$ }
|
|
||||||
//$$ }
|
|
||||||
//#endif
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.replaymod.replay.mixin;
|
||||||
|
|
||||||
|
import com.replaymod.replay.camera.CameraEntity;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(EntityRenderer.class)
|
||||||
|
public class MixinEntityRenderer {
|
||||||
|
@Shadow private float prevCamRoll;
|
||||||
|
@Shadow private float camRoll;
|
||||||
|
@Shadow private Minecraft mc;
|
||||||
|
|
||||||
|
@Inject(method = "orientCamera", at = @At("HEAD"))
|
||||||
|
private void applyRoll(float partialTicks, CallbackInfo ci) {
|
||||||
|
EntityLivingBase view = mc.renderViewEntity;
|
||||||
|
if (view instanceof CameraEntity) {
|
||||||
|
prevCamRoll = camRoll = ((CameraEntity) view).roll;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user