From c99d9fa1fc01133809c1a888f189ca78a8ad288f Mon Sep 17 00:00:00 2001 From: Eldrinn-Elantey <46845681+Eldrinn-Elantey@users.noreply.github.com> Date: Sat, 30 May 2026 06:02:02 +0400 Subject: [PATCH] render traveller accessories from Baubles slots when Tinker tab is disabled --- .../tconstruct/armor/ArmorProxyClient.java | 104 +++++++++++------- 1 file changed, 65 insertions(+), 39 deletions(-) diff --git a/src/main/java/tconstruct/armor/ArmorProxyClient.java b/src/main/java/tconstruct/armor/ArmorProxyClient.java index 01510c6390..7ef97981e0 100644 --- a/src/main/java/tconstruct/armor/ArmorProxyClient.java +++ b/src/main/java/tconstruct/armor/ArmorProxyClient.java @@ -341,50 +341,76 @@ void renderArmorExtras(RenderPlayerEvent.SetArmorModel event) { float limbSwing = player.prevLimbSwingAmount + (player.limbSwingAmount - player.prevLimbSwingAmount) * partialTick; float limbSwingMod = player.limbSwing - player.limbSwingAmount * (1.0F - partialTick); - // TPlayerStats stats = TPlayerStats.get(player); - ArmorExtended armor = ArmorProxyClient.armorExtended; // TODO: Do this for every player, not just the client - if (armor != null && armor.inventory[1] != null) { - if (getTranslucencyLevel(armor.inventory[1]) != 2 - && !(player.isInvisible() && getTranslucencyLevel(armor.inventory[1]) > 0)) { - Item item = armor.inventory[1].getItem(); - ModelBiped model = item.getArmorModel(player, armor.inventory[1], 4); - - if (item instanceof IAccessoryModel) { - this.mc.getTextureManager() - .bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1)); - model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick); - model.render( - player, - limbSwingMod, - limbSwing, - pitch, - yawRotation - yawOffset, - bodyRotation, - zeropointsixtwofive); + if (PHConstruct.enableTinkerInventoryTab) { + ArmorExtended armor = ArmorProxyClient.armorExtended; + if (armor != null && armor.inventory[1] != null) { + if (getTranslucencyLevel(armor.inventory[1]) != 2 + && !(player.isInvisible() && getTranslucencyLevel(armor.inventory[1]) > 0)) { + Item item = armor.inventory[1].getItem(); + ModelBiped model = item.getArmorModel(player, armor.inventory[1], 4); + + if (item instanceof IAccessoryModel) { + this.mc.getTextureManager() + .bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1)); + model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick); + model.render( + player, + limbSwingMod, + limbSwing, + pitch, + yawRotation - yawOffset, + bodyRotation, + zeropointsixtwofive); + } } } - } - if (armor != null && armor.inventory[3] != null) { - if (getTranslucencyLevel(armor.inventory[3]) != 2 - && !(player.isInvisible() && getTranslucencyLevel(armor.inventory[3]) > 0)) { - Item item = armor.inventory[3].getItem(); - ModelBiped model = item.getArmorModel(player, armor.inventory[3], 5); - - if (item instanceof IAccessoryModel) { - this.mc.getTextureManager() - .bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1)); - model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick); - model.render( - player, - limbSwingMod, - limbSwing, - pitch, - yawRotation - yawOffset, - bodyRotation, - zeropointsixtwofive); + if (armor != null && armor.inventory[3] != null) { + if (getTranslucencyLevel(armor.inventory[3]) != 2 + && !(player.isInvisible() && getTranslucencyLevel(armor.inventory[3]) > 0)) { + Item item = armor.inventory[3].getItem(); + ModelBiped model = item.getArmorModel(player, armor.inventory[3], 5); + + if (item instanceof IAccessoryModel) { + this.mc.getTextureManager() + .bindTexture(((IAccessoryModel) item).getWearbleTexture(player, armor.inventory[1], 1)); + model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick); + model.render( + player, + limbSwingMod, + limbSwing, + pitch, + yawRotation - yawOffset, + bodyRotation, + zeropointsixtwofive); + } } } + } else { + ItemStack[] baubles = tconstruct.compat.BaublesHelper.getBaubleStacks(player); + if (baubles == null) return; + + for (int i = 0; i < baubles.length; i++) { + ItemStack stack = baubles[i]; + if (stack == null) continue; + Item item = stack.getItem(); + if (!(item instanceof IAccessoryModel)) continue; + if (getTranslucencyLevel(stack) == 2) continue; + if (player.isInvisible() && getTranslucencyLevel(stack) > 0) continue; + + ModelBiped model = item.getArmorModel(player, stack, i); + if (model == null) continue; + this.mc.getTextureManager().bindTexture(((IAccessoryModel) item).getWearbleTexture(player, stack, i)); + model.setLivingAnimations(player, limbSwingMod, limbSwing, partialTick); + model.render( + player, + limbSwingMod, + limbSwing, + pitch, + yawRotation - yawOffset, + bodyRotation, + zeropointsixtwofive); + } } }