feat: Guardians

This commit is contained in:
Lord_Cambion
2026-04-10 14:03:32 +02:00
parent c7127b219d
commit 61b6e6adca
32 changed files with 1154 additions and 23 deletions

View File

@@ -31,6 +31,17 @@ void MobRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z,
renderLeash(mob, x, y, z, rot, a);
}
bool MobRenderer::shouldRender(shared_ptr<Entity> entity, float camX, float camY, float camZ)
{
double dx = entity->x - camX;
double dy = entity->y - camY;
double dz = entity->z - camZ;
double distSq = dx*dx + dy*dy + dz*dz;
return entity->shouldRenderAtSqrDistance(distSq);
}
bool MobRenderer::shouldShowName(shared_ptr<LivingEntity> mob)
{
return LivingEntityRenderer::shouldShowName(mob) && (mob->shouldShowName() || dynamic_pointer_cast<Mob>(mob)->hasCustomName());