refactor: remove duplicate custom name handling in boss renderers

The custom name assignment for boss mobs is already handled inside
the `BossMobGuiInfo::setBossHealth` method. The removed code in both
`WitherBossRenderer` and `EnderDragonRenderer` was redundant and not working.
This commit is contained in:
George V. 2026-04-09 21:03:30 +03:00
parent 506ebd2176
commit a0d5c649b9
No known key found for this signature in database
GPG key ID: 1DB61094F2DD4982
2 changed files with 10 additions and 8 deletions

View file

@ -89,10 +89,11 @@ void EnderDragonRenderer::render(shared_ptr<Entity> _mob, double x, double y, do
// 4J - dynamic cast required because we aren't using templates/generics in our version
shared_ptr<EnderDragon> mob = dynamic_pointer_cast<EnderDragon>(_mob);
BossMobGuiInfo::setBossHealth(mob, false);
if (!mob->getCustomName().empty())
{
BossMobGuiInfo::name = mob->getCustomName();
}
// GeorgeV22 - BossMobGuiInfo::setBossHealth already handles this
// if (!mob->getCustomName().empty())
// {
// BossMobGuiInfo::name = mob->getCustomName();
// }
MobRenderer::render(mob, x, y, z, rot, a);
if (mob->nearestCrystal != nullptr)

View file

@ -20,10 +20,11 @@ void WitherBossRenderer::render(shared_ptr<Entity> entity, double x, double y, d
shared_ptr<WitherBoss> mob = dynamic_pointer_cast<WitherBoss>(entity);
BossMobGuiInfo::setBossHealth(mob, true);
if (!mob->getCustomName().empty())
{
BossMobGuiInfo::name = mob->getCustomName();
}
// GeorgeV22 - BossMobGuiInfo::setBossHealth already handles this
// if (!mob->getCustomName().empty())
// {
// BossMobGuiInfo::name = mob->getCustomName();
// }
int modelVersion = dynamic_cast<WitherBossModel*>(model)->modelVersion();
if (modelVersion != this->modelVersion)