use of com.tntmodders.takumi.client.render.sp.RenderPlayerSP in project takumicraft by TNTModders.
the class TakumiClientEvents method renderPlayer.
@SubscribeEvent
public void renderPlayer(Pre event) {
if (TakumiUtils.isApril(Minecraft.getMinecraft().world) && (event.getRenderer() instanceof RenderPlayer && !(event.getRenderer() instanceof RenderPlayerSP)) && event.getEntity() instanceof AbstractClientPlayer) {
event.setCanceled(true);
RenderPlayerSP sp = new RenderPlayerSP(event.getRenderer().getRenderManager());
sp.doRender(((AbstractClientPlayer) event.getEntity()), event.getX(), event.getY(), event.getZ(), ((AbstractClientPlayer) event.getEntity()).rotationYaw, event.getPartialRenderTick());
}
if (event.getEntity().isPotionActive(TakumiPotionCore.INVERSION)) {
GlStateManager.popMatrix();
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.translate(0, -1.9, 0);
}
if (event.getEntity().isPotionActive(TakumiPotionCore.CREEPERED)) {
GlStateManager.popMatrix();
float f = this.getCreeperFlashIntensity(event.getEntity(), event.getPartialRenderTick());
if (f > 0) {
float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
f = MathHelper.clamp(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f2 = (1.0F + f * 0.4F) * f1;
float f3 = (1.0F + f * 0.1F) / f1;
GlStateManager.scale(f2, f3, f2);
}
}
}
Aggregations