From 24c74aa225152f8041cb87e6e9f4a3cbbb2be133 Mon Sep 17 00:00:00 2001 From: Langtanium <94726057+Langtanium@users.noreply.github.com> Date: Tue, 14 Apr 2026 16:30:16 -0700 Subject: [PATCH] Added skin box hide bit functionality Added code to hide skin boxes when wearing a helmet if bit for said functionality is present. --- Minecraft.Client/HumanoidModel.cpp | 1 + Minecraft.Client/ModelPart.cpp | 1 + Minecraft.Client/ModelPart.h | 1 + Minecraft.Client/PlayerRenderer.cpp | 4 +++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Minecraft.Client/HumanoidModel.cpp b/Minecraft.Client/HumanoidModel.cpp index a790861f..f5d31924 100644 --- a/Minecraft.Client/HumanoidModel.cpp +++ b/Minecraft.Client/HumanoidModel.cpp @@ -109,6 +109,7 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox) pNewBox = new ModelPart(this, static_cast(pBox->fU), static_cast(pBox->fV)); pNewBox->visible=false; if (pBox->fM > 0) pNewBox->bMirror = true; // check if this box has the mirror flag + if (pBox->fA > 0) pNewBox->hideWithHelmet = true; // check if this box has the "hide when helmet" is worn flag pNewBox->addHumanoidBox(pBox->fX, pBox->fY, pBox->fZ, pBox->fW, pBox->fH, pBox->fD, scale); // 4J-PB - don't compile here, since the lighting isn't set up. It'll be compiled on first use. //pNewBox->compile(1.0f/16.0f); diff --git a/Minecraft.Client/ModelPart.cpp b/Minecraft.Client/ModelPart.cpp index e423a4ae..8a39dbf4 100644 --- a/Minecraft.Client/ModelPart.cpp +++ b/Minecraft.Client/ModelPart.cpp @@ -13,6 +13,7 @@ void ModelPart::_init() compiled=false; bMirror = false; visible = true; + hideWithHelmet = false; neverRender = false; x=y=z = 0.0f; xRot=yRot=zRot = 0.0f; diff --git a/Minecraft.Client/ModelPart.h b/Minecraft.Client/ModelPart.h index c6458e71..7ba7cb39 100644 --- a/Minecraft.Client/ModelPart.h +++ b/Minecraft.Client/ModelPart.h @@ -16,6 +16,7 @@ public: float xRot, yRot, zRot; bool bMirror; bool visible; + bool hideWithHelmet; bool neverRender; vector cubes; vector children; diff --git a/Minecraft.Client/PlayerRenderer.cpp b/Minecraft.Client/PlayerRenderer.cpp index e0973da9..61a0af8f 100644 --- a/Minecraft.Client/PlayerRenderer.cpp +++ b/Minecraft.Client/PlayerRenderer.cpp @@ -258,7 +258,9 @@ void PlayerRenderer::render(shared_ptr _mob, double x, double y, double { for(ModelPart *pModelPart : *pAdditionalModelParts) { - pModelPart->visible=true; + shared_ptr itemInstance = mob->inventory->getArmor(3); + if (itemInstance == nullptr || !pModelPart->hideWithHelmet) + pModelPart->visible=true; } }