Merge pull request #733 from Howaner/Slabs
Fix Double Slabs, fix Slab Meta and add more things to burnable
This commit is contained in:
commit
0f2d9bc35f
@ -28,7 +28,7 @@ public:
|
||||
|
||||
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
||||
{
|
||||
a_Pickups.push_back(cItem(m_BlockType, 1, a_BlockMeta));
|
||||
a_Pickups.push_back(cItem(m_BlockType, 1, a_BlockMeta & 0x7));
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ public:
|
||||
{
|
||||
a_BlockType = m_BlockType;
|
||||
BLOCKTYPE Type = (BLOCKTYPE) (a_Player->GetEquippedItem().m_ItemType);
|
||||
NIBBLETYPE Meta = (NIBBLETYPE)(a_Player->GetEquippedItem().m_ItemDamage & 0x07);
|
||||
NIBBLETYPE Meta = (NIBBLETYPE) a_Player->GetEquippedItem().m_ItemDamage;
|
||||
|
||||
// HandlePlaceBlock wants a cItemHandler pointer thing, so let's give it one
|
||||
cItemHandler * ItemHandler = cItemHandler::GetItemHandler(GetDoubleSlabType(Type));
|
||||
@ -159,21 +159,30 @@ public:
|
||||
|
||||
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
||||
{
|
||||
if (m_BlockType == E_BLOCK_DOUBLE_STONE_SLAB)
|
||||
{
|
||||
m_BlockType = E_BLOCK_STONE_SLAB;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_BlockType = E_BLOCK_WOODEN_SLAB;
|
||||
}
|
||||
a_Pickups.push_back(cItem(m_BlockType, 2, a_BlockMeta));
|
||||
BLOCKTYPE Block = GetSingleSlabType(m_BlockType);
|
||||
a_Pickups.push_back(cItem(Block, 2, a_BlockMeta & 0x7));
|
||||
}
|
||||
|
||||
inline static BLOCKTYPE GetSingleSlabType(BLOCKTYPE a_BlockType)
|
||||
{
|
||||
switch (a_BlockType)
|
||||
{
|
||||
case E_BLOCK_DOUBLE_STONE_SLAB: return E_BLOCK_STONE_SLAB;
|
||||
case E_BLOCK_DOUBLE_WOODEN_SLAB: return E_BLOCK_WOODEN_SLAB;
|
||||
}
|
||||
ASSERT(!"Unhandled double slab type!");
|
||||
return a_BlockType;
|
||||
}
|
||||
|
||||
virtual const char * GetStepSound(void) override
|
||||
{
|
||||
return ((m_BlockType == E_BLOCK_DOUBLE_WOODEN_SLAB) || (m_BlockType == E_BLOCK_DOUBLE_WOODEN_SLAB)) ? "step.wood" : "step.stone";
|
||||
switch (m_BlockType)
|
||||
{
|
||||
case E_BLOCK_DOUBLE_STONE_SLAB: return "step.stone";
|
||||
case E_BLOCK_DOUBLE_WOODEN_SLAB: return "step.wood";
|
||||
}
|
||||
ASSERT(!"Unhandled double slab type!");
|
||||
return "";
|
||||
}
|
||||
} ;
|
||||
|
||||
|
@ -1043,7 +1043,7 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, e
|
||||
if (
|
||||
cBlockSlabHandler::IsAnySlabType(ClickedBlock) && // Is there a slab already?
|
||||
cBlockSlabHandler::IsAnySlabType(EquippedBlock) && // Is the player placing another slab?
|
||||
((ClickedBlockMeta & 0x07) == (EquippedBlockDamage & 0x07)) && // Is it the same slab type?
|
||||
((ClickedBlockMeta & 0x07) == EquippedBlockDamage) && // Is it the same slab type?
|
||||
(
|
||||
(a_BlockFace == BLOCK_FACE_TOP) || // Clicking the top of a bottom slab
|
||||
(a_BlockFace == BLOCK_FACE_BOTTOM) // Clicking the bottom of a top slab
|
||||
|
@ -162,14 +162,27 @@ bool cFireSimulator::IsFuel(BLOCKTYPE a_BlockType)
|
||||
switch (a_BlockType)
|
||||
{
|
||||
case E_BLOCK_PLANKS:
|
||||
case E_BLOCK_DOUBLE_WOODEN_SLAB:
|
||||
case E_BLOCK_WOODEN_SLAB:
|
||||
case E_BLOCK_WOODEN_STAIRS:
|
||||
case E_BLOCK_SPRUCE_WOOD_STAIRS:
|
||||
case E_BLOCK_BIRCH_WOOD_STAIRS:
|
||||
case E_BLOCK_JUNGLE_WOOD_STAIRS:
|
||||
case E_BLOCK_LEAVES:
|
||||
case E_BLOCK_NEW_LEAVES:
|
||||
case E_BLOCK_LOG:
|
||||
case E_BLOCK_NEW_LOG:
|
||||
case E_BLOCK_WOOL:
|
||||
case E_BLOCK_BOOKCASE:
|
||||
case E_BLOCK_FENCE:
|
||||
case E_BLOCK_TNT:
|
||||
case E_BLOCK_VINES:
|
||||
case E_BLOCK_HAY_BALE:
|
||||
case E_BLOCK_TALL_GRASS:
|
||||
case E_BLOCK_BIG_FLOWER:
|
||||
case E_BLOCK_DANDELION:
|
||||
case E_BLOCK_FLOWER:
|
||||
case E_BLOCK_CARPET:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user