summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2014-09-27 15:17:13 +0200
committerAlexander Harkness <me@bearbin.net>2014-09-27 15:17:13 +0200
commit4df56fde88b30d9a3f58b7efe8b281a0ca36f42b (patch)
treec7926219388c6ebe41effe4046036c797feb4451 /src/Blocks
parentRemoved polarSSL makefile. Fixes #591. (diff)
parentAdded default value to switch and spruce gate to fence gate handler (diff)
downloadcuberite-4df56fde88b30d9a3f58b7efe8b281a0ca36f42b.tar
cuberite-4df56fde88b30d9a3f58b7efe8b281a0ca36f42b.tar.gz
cuberite-4df56fde88b30d9a3f58b7efe8b281a0ca36f42b.tar.bz2
cuberite-4df56fde88b30d9a3f58b7efe8b281a0ca36f42b.tar.lz
cuberite-4df56fde88b30d9a3f58b7efe8b281a0ca36f42b.tar.xz
cuberite-4df56fde88b30d9a3f58b7efe8b281a0ca36f42b.tar.zst
cuberite-4df56fde88b30d9a3f58b7efe8b281a0ca36f42b.zip
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockDoor.h44
-rw-r--r--src/Blocks/BlockFenceGate.h2
-rw-r--r--src/Blocks/BlockHandler.cpp1
3 files changed, 45 insertions, 2 deletions
diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h
index b2f9e4dcd..0ff8bcfc8 100644
--- a/src/Blocks/BlockDoor.h
+++ b/src/Blocks/BlockDoor.h
@@ -55,7 +55,49 @@ public:
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
- a_Pickups.push_back(cItem((m_BlockType == E_BLOCK_WOODEN_DOOR) ? E_ITEM_WOODEN_DOOR : E_ITEM_IRON_DOOR, 1, 0));
+ switch (m_BlockType)
+ {
+ case E_BLOCK_WOODEN_DOOR:
+ {
+ a_Pickups.Add(E_ITEM_WOODEN_DOOR);
+ break;
+ }
+ case E_BLOCK_ACACIA_DOOR:
+ {
+ a_Pickups.Add(E_ITEM_ACACIA_DOOR);
+ break;
+ }
+ case E_BLOCK_BIRCH_DOOR:
+ {
+ a_Pickups.Add(E_ITEM_BIRCH_DOOR);
+ break;
+ }
+ case E_BLOCK_DARK_OAK_DOOR:
+ {
+ a_Pickups.Add(E_ITEM_DARK_OAK_DOOR);
+ break;
+ }
+ case E_BLOCK_JUNGLE_DOOR:
+ {
+ a_Pickups.Add(E_ITEM_JUNGLE_DOOR);
+ break;
+ }
+ case E_BLOCK_SPRUCE_DOOR:
+ {
+ a_Pickups.Add(E_ITEM_SPRUCE_DOOR);
+ break;
+ }
+ case E_BLOCK_IRON_DOOR:
+ {
+ a_Pickups.Add(E_ITEM_IRON_DOOR);
+ break;
+ }
+ default:
+ {
+ ASSERT(!"Unhandled door type!");
+ break;
+ }
+ }
}
diff --git a/src/Blocks/BlockFenceGate.h b/src/Blocks/BlockFenceGate.h
index 3041dd46c..b5c1323bd 100644
--- a/src/Blocks/BlockFenceGate.h
+++ b/src/Blocks/BlockFenceGate.h
@@ -19,7 +19,7 @@ public:
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
- a_Pickups.Add(E_BLOCK_FENCE_GATE, 1, 0); // Reset meta to zero
+ a_Pickups.Add(m_BlockType, 1, 0); // Reset meta to zero
}
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp
index 7bfff0545..ff0b201e7 100644
--- a/src/Blocks/BlockHandler.cpp
+++ b/src/Blocks/BlockHandler.cpp
@@ -294,6 +294,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
case E_BLOCK_SIGN_POST: return new cBlockSignPostHandler (a_BlockType);
case E_BLOCK_SNOW: return new cBlockSnowHandler (a_BlockType);
case E_BLOCK_SPRUCE_DOOR: return new cBlockDoorHandler (a_BlockType);
+ case E_BLOCK_SPRUCE_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
case E_BLOCK_SPRUCE_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
case E_BLOCK_STAINED_GLASS: return new cBlockGlassHandler (a_BlockType);
case E_BLOCK_STAINED_GLASS_PANE: return new cBlockGlassHandler (a_BlockType);