summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockHandler.cpp
diff options
context:
space:
mode:
authorJaume Aloy <hircine45@gmail.com>2014-08-19 17:57:32 +0200
committerJaume Aloy <hircine45@gmail.com>2014-08-19 17:57:32 +0200
commit596203e692e6322c7f989b1625cbe03dc1eb6a6c (patch)
tree3c3b53fa00e31a10f68fd96984b59114d041dac5 /src/Blocks/BlockHandler.cpp
parentChanged if for switch (diff)
downloadcuberite-596203e692e6322c7f989b1625cbe03dc1eb6a6c.tar
cuberite-596203e692e6322c7f989b1625cbe03dc1eb6a6c.tar.gz
cuberite-596203e692e6322c7f989b1625cbe03dc1eb6a6c.tar.bz2
cuberite-596203e692e6322c7f989b1625cbe03dc1eb6a6c.tar.lz
cuberite-596203e692e6322c7f989b1625cbe03dc1eb6a6c.tar.xz
cuberite-596203e692e6322c7f989b1625cbe03dc1eb6a6c.tar.zst
cuberite-596203e692e6322c7f989b1625cbe03dc1eb6a6c.zip
Diffstat (limited to 'src/Blocks/BlockHandler.cpp')
-rw-r--r--src/Blocks/BlockHandler.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp
index 1d537b125..d6be99f83 100644
--- a/src/Blocks/BlockHandler.cpp
+++ b/src/Blocks/BlockHandler.cpp
@@ -427,49 +427,49 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac
// Thanks to daniel0916
cPlayer * Player = (cPlayer *)a_Digger;
cEnchantments Enchantments = Player->GetInventory().GetEquippedItem().m_Enchantments;
- if (Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0)
- {
- BLOCKTYPE Type = a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ);
- switch (Type)
- {
- case E_BLOCK_CAKE:
- 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
- ConvertToPickups(Pickups, Meta);
- };
- default: Pickups.Add(m_BlockType, 1, Meta);
- }
- }
- else
+
+ if (a_CanDrop)
{
- if (a_CanDrop)
+ if (!a_DropVerbatim)
{
- if (!a_DropVerbatim)
+ if (Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0)
{
- ConvertToPickups(Pickups, Meta);
+ switch (m_BlockType)
+ {
+ case E_BLOCK_CAKE:
+ 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
+ ConvertToPickups(Pickups, Meta);
+ break;
+ };
+ default: Pickups.Add(m_BlockType, 1, Meta);
+ }
}
else
{
- // TODO: Add a proper overridable function for this
- Pickups.Add(m_BlockType, 1, Meta);
+ ConvertToPickups(Pickups, Meta);
}
}
-
+ else
+ {
+ // TODO: Add a proper overridable function for this
+ Pickups.Add(m_BlockType, 1, Meta);
+ }
}
// Allow plugins to modify the pickups: