1
0

Merge pull request #1459 from Masy98/blocks

Fixed drops for Doors and Fence Gates
This commit is contained in:
Alexander Harkness 2014-09-27 14:17:13 +01:00
commit 4df56fde88
3 changed files with 45 additions and 2 deletions

View File

@ -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;
}
}
}

View File

@ -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
}

View File

@ -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);