summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaume Aloy <hircine45@gmail.com>2014-08-19 16:47:33 +0200
committerJaume Aloy <hircine45@gmail.com>2014-08-19 16:47:33 +0200
commit07350de514cebd9009f5fbdb5774aa8f1266bdb3 (patch)
tree576e41407d58d88717f4162f5d98d2f48d58d042
parentAdded more enchantments and some fixes (diff)
downloadcuberite-07350de514cebd9009f5fbdb5774aa8f1266bdb3.tar
cuberite-07350de514cebd9009f5fbdb5774aa8f1266bdb3.tar.gz
cuberite-07350de514cebd9009f5fbdb5774aa8f1266bdb3.tar.bz2
cuberite-07350de514cebd9009f5fbdb5774aa8f1266bdb3.tar.lz
cuberite-07350de514cebd9009f5fbdb5774aa8f1266bdb3.tar.xz
cuberite-07350de514cebd9009f5fbdb5774aa8f1266bdb3.tar.zst
cuberite-07350de514cebd9009f5fbdb5774aa8f1266bdb3.zip
-rw-r--r--src/Blocks/BlockHandler.cpp33
-rw-r--r--src/Blocks/BlockIce.h2
-rw-r--r--src/Entities/Entity.cpp5
3 files changed, 25 insertions, 15 deletions
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp
index 3c85a31e0..1d537b125 100644
--- a/src/Blocks/BlockHandler.cpp
+++ b/src/Blocks/BlockHandler.cpp
@@ -430,18 +430,29 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac
if (Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0)
{
BLOCKTYPE Type = a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ);
- if (Type == E_BLOCK_CAKE || Type == E_BLOCK_CARROTS || Type == E_BLOCK_COCOA_POD || Type == E_BLOCK_DOUBLE_STONE_SLAB ||
- Type == E_BLOCK_DOUBLE_WOODEN_SLAB || Type == E_BLOCK_FIRE || Type == E_BLOCK_FARMLAND || Type == E_BLOCK_MELON_STEM ||
- Type == E_BLOCK_MOB_SPAWNER || Type == E_BLOCK_NETHER_WART || Type == E_BLOCK_POTATOES || Type == E_BLOCK_PUMPKIN_STEM ||
- Type == E_BLOCK_SNOW || Type == E_BLOCK_SUGARCANE || Type == E_BLOCK_TALL_GRASS || Type == E_BLOCK_CROPS
- )
+ switch (Type)
{
- // Silktouch can't be used for this blocks
- ConvertToPickups(Pickups, Meta);
- }
- else
- {
- Pickups.Add(m_BlockType, 1, Meta);
+ 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
diff --git a/src/Blocks/BlockIce.h b/src/Blocks/BlockIce.h
index cfe1d179f..47a84e5a7 100644
--- a/src/Blocks/BlockIce.h
+++ b/src/Blocks/BlockIce.h
@@ -44,4 +44,4 @@ public:
// This is called later than the real destroying of this ice block
}
}
-} ; \ No newline at end of file
+} ;
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 05bad3a78..4316b48e9 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -384,11 +384,10 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
case cMonster::mtGhast:
case cMonster::mtZombiePigman:
case cMonster::mtMagmaCube:
- {
-
+ {
break;
};
- default:StartBurning(BurnTicks * 20);
+ default: StartBurning(BurnTicks * 20);
}
}