use of de.sanandrew.mods.claysoldiers.client.render.EntityRendererClayCam in project ClaySoldiersMod by SanAndreasP.
the class RenderClayCamHandler method onRenderTick.
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent event) {
Minecraft mc = Minecraft.getMinecraft();
if (event.phase == Phase.START) {
if (mc.thePlayer != null && ClientProxy.s_clayCamEntity != null) {
if (this.viewMode == -1) {
this.viewMode = mc.gameSettings.thirdPersonView;
}
mc.gameSettings.thirdPersonView = 1;
if (this.p_clayCamRenderer == null) {
this.p_clayCamRenderer = new EntityRendererClayCam(mc, mc.getResourceManager());
}
if (mc.entityRenderer != this.p_clayCamRenderer) {
// be sure to store the previous renderer
this.p_prevEntityRenderer = mc.entityRenderer;
mc.entityRenderer = this.p_clayCamRenderer;
}
if (mc.thePlayer.isSneaking() || ClientProxy.s_clayCamEntity.isDead) {
mc.gameSettings.thirdPersonView = this.viewMode;
this.viewMode = -1;
ClaySoldiersMod.proxy.switchClayCam(false, null);
}
} else if (this.p_prevEntityRenderer != null && mc.entityRenderer != this.p_prevEntityRenderer) {
// reset the renderer
mc.entityRenderer = this.p_prevEntityRenderer;
}
} else if (ClientProxy.s_clayCamEntity != null) {
mc.gameSettings.thirdPersonView = this.viewMode;
}
}
Aggregations