MinecraftConsoles/Minecraft.Client/ChickenRenderer.cpp
Riley M. c0da06e4ee
major: Switch to forward slashes(+more) to fix compilation on Linux (#1403)
Notably also adds some metadata files for NixOS 

* add support for linux clang cross compiles

* add linux clang instructions

* un-capitalize Mob.horse.*

* update the description in flake.nix

---------

Co-authored-by: Loki <lokirautio@gmail.com>
2026-04-14 16:47:37 -05:00

31 lines
1,006 B
C++

#include "stdafx.h"
#include "../Minecraft.World/Mth.h"
#include "ChickenRenderer.h"
#include "../Minecraft.World/net.minecraft.world.entity.animal.h"
ResourceLocation ChickenRenderer::CHICKEN_LOCATION = ResourceLocation(TN_MOB_CHICKEN);
ChickenRenderer::ChickenRenderer(Model *model, float shadow) : MobRenderer(model,shadow)
{
}
void ChickenRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)
{
MobRenderer::render(_mob, x, y, z, rot, a);
}
float ChickenRenderer::getBob(shared_ptr<LivingEntity> _mob, float a)
{
// 4J - dynamic cast required because we aren't using templates/generics in our version
shared_ptr<Chicken> mob = dynamic_pointer_cast<Chicken>(_mob);
float flap = mob->oFlap+(mob->flap-mob->oFlap)*a;
float flapSpeed = mob->oFlapSpeed+(mob->flapSpeed-mob->oFlapSpeed)*a;
return (Mth::sin(flap)+1)*flapSpeed;
}
ResourceLocation *ChickenRenderer::getTextureLocation(shared_ptr<Entity> mob)
{
return &CHICKEN_LOCATION;
}