Fixed a few issues and added more functionality

Fixed player not rendering in third person and armor arm0 not moving with 64x64 skins. Added offsets to held item (main hand) and armor (boots).
This commit is contained in:
Langtanium 2026-04-18 11:41:06 -07:00
parent 0c50f9982c
commit cef65c8df3
8 changed files with 306 additions and 39 deletions

View file

@ -76,6 +76,11 @@ int PlayerRenderer::prepareArmor(shared_ptr<LivingEntity> _player, int layer, fl
{
// 4J - dynamic cast required because we aren't using templates/generics in our version
shared_ptr<Player> player = dynamic_pointer_cast<Player>(_player);
HumanoidModel *resModel;
if (humanoidModelClassic != nullptr && (player->getCustomSkin() == 18 || player->getAnimOverrideBitmask()&(1<<HumanoidModel::eAnim_ClassicModel))) resModel = humanoidModelClassic;
else if (humanoidModelSlim != nullptr && ((player->getCustomSkin() >= 8 && player->getCustomSkin() <= 17) || player->getAnimOverrideBitmask()&(1<<HumanoidModel::eAnim_SlimModel))) resModel = humanoidModelSlim;
else resModel = humanoidModel;
// 4J-PB - need to disable rendering armour for some special skins (Daleks)
unsigned int uiAnimOverrideBitmask=player->getAnimOverrideBitmask();
@ -103,10 +108,18 @@ int PlayerRenderer::prepareArmor(shared_ptr<LivingEntity> _player, int layer, fl
armor->leg0->visible = layer == 2 || layer == 3;
armor->leg1->visible = layer == 2 || layer == 3;
armor->head->isArmorPart1 = layer == 0;
armor->hair->isArmorPart1 = layer == 0;
armor->body->isArmorPart1 = layer == 1;
armor->arm0->isArmorPart1 = layer == 1;
armor->arm1->isArmorPart1 = layer == 1;
armor->leg0->isArmorPart1 = layer == 3;
armor->leg1->isArmorPart1 = layer == 3;
setArmor(armor);
if (armor != nullptr) armor->attackTime = model->attackTime;
if (armor != nullptr) armor->riding = model->riding;
if (armor != nullptr) armor->young = model->young;
if (armor != nullptr) armor->attackTime = resModel->attackTime;
if (armor != nullptr) armor->riding = resModel->riding;
if (armor != nullptr) armor->young = resModel->young;
float brightness = SharedConstants::TEXTURE_LIGHTING ? 1 : player->getBrightness(a);
if (armorItem->getMaterial() == ArmorItem::ArmorMaterial::CLOTH)