Added a_Digger check
This commit is contained in:
parent
7d771953c0
commit
4900645b28
@ -433,38 +433,41 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: Add a proper overridable function for this
|
// TODO: Add a proper overridable function for this
|
||||||
cEnchantments Enchantments = a_Digger->GetEquippedWeapon().m_Enchantments;
|
if (a_Digger != NULL)
|
||||||
if ((Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0) && a_Digger->IsPlayer())
|
|
||||||
{
|
{
|
||||||
switch (m_BlockType)
|
cEnchantments Enchantments = a_Digger->GetEquippedWeapon().m_Enchantments;
|
||||||
|
if ((Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0) && a_Digger->IsPlayer())
|
||||||
{
|
{
|
||||||
case E_BLOCK_CAKE:
|
switch (m_BlockType)
|
||||||
case E_BLOCK_CARROTS:
|
|
||||||
case E_BLOCK_COCOA_POD:
|
|
||||||
case E_BLOCK_DOUBLE_STONE_SLAB:
|
|
||||||
case E_BLOCK_DOUBLE_WOODEN_SLAB:
|
|
||||||
case E_BLOCK_FIRE:
|
|
||||||
case E_BLOCK_FARMLAND:
|
|
||||||
case E_BLOCK_MELON_STEM:
|
|
||||||
case E_BLOCK_MOB_SPAWNER:
|
|
||||||
case E_BLOCK_NETHER_WART:
|
|
||||||
case E_BLOCK_POTATOES:
|
|
||||||
case E_BLOCK_PUMPKIN_STEM:
|
|
||||||
case E_BLOCK_SNOW:
|
|
||||||
case E_BLOCK_SUGARCANE:
|
|
||||||
case E_BLOCK_TALL_GRASS:
|
|
||||||
case E_BLOCK_CROPS:
|
|
||||||
{
|
{
|
||||||
// Silktouch can't be used for this blocks
|
case E_BLOCK_CAKE:
|
||||||
ConvertToPickups(Pickups, Meta);
|
case E_BLOCK_CARROTS:
|
||||||
break;
|
case E_BLOCK_COCOA_POD:
|
||||||
};
|
case E_BLOCK_DOUBLE_STONE_SLAB:
|
||||||
default: Pickups.Add(m_BlockType, 1, Meta);
|
case E_BLOCK_DOUBLE_WOODEN_SLAB:
|
||||||
|
case E_BLOCK_FIRE:
|
||||||
|
case E_BLOCK_FARMLAND:
|
||||||
|
case E_BLOCK_MELON_STEM:
|
||||||
|
case E_BLOCK_MOB_SPAWNER:
|
||||||
|
case E_BLOCK_NETHER_WART:
|
||||||
|
case E_BLOCK_POTATOES:
|
||||||
|
case E_BLOCK_PUMPKIN_STEM:
|
||||||
|
case E_BLOCK_SNOW:
|
||||||
|
case E_BLOCK_SUGARCANE:
|
||||||
|
case E_BLOCK_TALL_GRASS:
|
||||||
|
case E_BLOCK_CROPS:
|
||||||
|
{
|
||||||
|
// Silktouch can't be used for this blocks
|
||||||
|
ConvertToPickups(Pickups, Meta);
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
default: Pickups.Add(m_BlockType, 1, Meta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Pickups.Add(m_BlockType, 1, Meta);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Pickups.Add(m_BlockType, 1, Meta);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
|
|||||||
for (size_t i = 0; i < ARRAYCOUNT(ArmorItems); i++)
|
for (size_t i = 0; i < ARRAYCOUNT(ArmorItems); i++)
|
||||||
{
|
{
|
||||||
cItem Item = ArmorItems[i];
|
cItem Item = ArmorItems[i];
|
||||||
if (Item.m_Enchantments.GetLevel(cEnchantments::enchThorns) > ThornsLevel) ThornsLevel = Item.m_Enchantments.GetLevel(cEnchantments::enchThorns);
|
ThornsLevel = std::max(ThornsLevel, Item.m_Enchantments.GetLevel(cEnchantments::enchThorns));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ThornsLevel > 0)
|
if (ThornsLevel > 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user