mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-23 07:27:20 +00:00
Fix witches' bottle color (#1205)
* fix: witches' bottle is now the right color * fix: add condition if item has mutiple layers
This commit is contained in:
parent
d131a551bf
commit
379434097a
|
|
@ -228,7 +228,7 @@ void ItemInHandRenderer::renderItem(shared_ptr<LivingEntity> mob, shared_ptr<Ite
|
||||||
// by texture lighting. This is for colourising things held in 3rd person view.
|
// by texture lighting. This is for colourising things held in 3rd person view.
|
||||||
if ( (setColor) && (item != nullptr) )
|
if ( (setColor) && (item != nullptr) )
|
||||||
{
|
{
|
||||||
int col = Item::items[item->id]->getColor(item,0);
|
int col = Item::items[item->id]->getColor(item, layer);
|
||||||
float red = ((col >> 16) & 0xff) / 255.0f;
|
float red = ((col >> 16) & 0xff) / 255.0f;
|
||||||
float g = ((col >> 8) & 0xff) / 255.0f;
|
float g = ((col >> 8) & 0xff) / 255.0f;
|
||||||
float b = ((col) & 0xff) / 255.0f;
|
float b = ((col) & 0xff) / 255.0f;
|
||||||
|
|
|
||||||
|
|
@ -1354,6 +1354,10 @@ bool LivingEntity::shouldShowName()
|
||||||
|
|
||||||
Icon *LivingEntity::getItemInHandIcon(shared_ptr<ItemInstance> item, int layer)
|
Icon *LivingEntity::getItemInHandIcon(shared_ptr<ItemInstance> item, int layer)
|
||||||
{
|
{
|
||||||
|
if (item->getItem()->hasMultipleSpriteLayers())
|
||||||
|
{
|
||||||
|
return item->getItem()->getLayerIcon(item->getAuxValue(), layer);
|
||||||
|
}
|
||||||
return item->getIcon();
|
return item->getIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1999,4 +2003,4 @@ bool LivingEntity::isAlliedTo(Team *other)
|
||||||
return getTeam()->isAlliedTo(other);
|
return getTeam()->isAlliedTo(other);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue