1
0

Protection Enchantments, some fixes

- Protection echantments (fire, blast, feather falling, protection and
projectile). It isn't finished, add secondary effects and optimize the
code.
- Removed some brackets.
- Silk touch fixed.
This commit is contained in:
Jaume Aloy
2014-08-21 12:08:38 +02:00
parent 5008eb8c83
commit 19d1c976e7
4 changed files with 122 additions and 15 deletions

View File

@@ -428,8 +428,14 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac
{
if (!a_DropVerbatim)
{
ConvertToPickups(Pickups, Meta);
}
else
{
// TODO: Add a proper overridable function for this
// Pickups.Add(m_BlockType, 1, Meta);
cEnchantments Enchantments = a_Digger->GetEquippedWeapon().m_Enchantments;
if ((Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0) && (a_Digger->IsPlayer()))
if ((Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0) && a_Digger->IsPlayer())
{
switch (m_BlockType)
{
@@ -459,14 +465,9 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac
}
else
{
ConvertToPickups(Pickups, Meta);
Pickups.Add(m_BlockType, 1, Meta);
}
}
else
{
// TODO: Add a proper overridable function for this
Pickups.Add(m_BlockType, 1, Meta);
}
}
// Allow plugins to modify the pickups: