Skip to content

Commit 3794340

Browse files
authored
Fix witches' bottle color (#1205)
* fix: witches' bottle is now the right color * fix: add condition if item has mutiple layers
1 parent d131a55 commit 3794340

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Minecraft.Client/ItemInHandRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void ItemInHandRenderer::renderItem(shared_ptr<LivingEntity> mob, shared_ptr<Ite
228228
// by texture lighting. This is for colourising things held in 3rd person view.
229229
if ( (setColor) && (item != nullptr) )
230230
{
231-
int col = Item::items[item->id]->getColor(item,0);
231+
int col = Item::items[item->id]->getColor(item, layer);
232232
float red = ((col >> 16) & 0xff) / 255.0f;
233233
float g = ((col >> 8) & 0xff) / 255.0f;
234234
float b = ((col) & 0xff) / 255.0f;

Minecraft.World/LivingEntity.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,10 @@ bool LivingEntity::shouldShowName()
13541354

13551355
Icon *LivingEntity::getItemInHandIcon(shared_ptr<ItemInstance> item, int layer)
13561356
{
1357+
if (item->getItem()->hasMultipleSpriteLayers())
1358+
{
1359+
return item->getItem()->getLayerIcon(item->getAuxValue(), layer);
1360+
}
13571361
return item->getIcon();
13581362
}
13591363

@@ -1999,4 +2003,4 @@ bool LivingEntity::isAlliedTo(Team *other)
19992003
return getTeam()->isAlliedTo(other);
20002004
}
20012005
return false;
2002-
}
2006+
}

0 commit comments

Comments
 (0)