Fixes
This commit is contained in:
parent
a595a4a842
commit
2a8c234f46
@ -452,10 +452,8 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info)
|
||||
a_Info[E_BLOCK_AIR ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_BIG_FLOWER ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_BROWN_MUSHROOM ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_CAKE ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_CARROTS ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_COBWEB ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_COCOA_POD ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_CROPS ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_DANDELION ].m_IsSolid = false;
|
||||
a_Info[E_BLOCK_DETECTOR_RAIL ].m_IsSolid = false;
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
{
|
||||
NIBBLETYPE Meta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);
|
||||
NIBBLETYPE TypeMeta = Meta & 0x03;
|
||||
int GrowState = (Meta & 0x12) >> 2;
|
||||
int GrowState = (Meta & 0x0f) >> 2;
|
||||
|
||||
if (GrowState < 2)
|
||||
{
|
||||
@ -51,7 +51,7 @@ public:
|
||||
|
||||
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
||||
{
|
||||
int GrowState = (a_BlockMeta & 0x12) >> 2;
|
||||
int GrowState = (a_BlockMeta & 0x0f) >> 2;
|
||||
a_Pickups.Add(E_ITEM_DYE, ((GrowState >= 2) ? 3 : 1), E_META_DYE_BROWN);
|
||||
}
|
||||
|
||||
|
@ -40,11 +40,13 @@ public:
|
||||
NIBBLETYPE BlockMeta;
|
||||
a_World->GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
|
||||
|
||||
// Check if the block that the player clicked is a jungle log.
|
||||
if ((BlockType != E_BLOCK_LOG) || ((BlockMeta & 0x3) != E_META_LOG_JUNGLE))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the location from the new cocoa pod.
|
||||
AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, false);
|
||||
BlockMeta = cBlockCocoaPodHandler::BlockFaceToMeta(a_BlockFace);
|
||||
|
||||
@ -53,6 +55,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check plugins
|
||||
if (cRoot::Get()->GetPluginManager()->CallHookPlayerPlacingBlock(*a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, 0, 0, 0, E_BLOCK_COCOA_POD, BlockMeta))
|
||||
{
|
||||
a_World->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player);
|
||||
@ -60,9 +63,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set block and broadcast place sound
|
||||
a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_COCOA_POD, BlockMeta);
|
||||
a_World->BroadcastSoundEffect("dig.stone", a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, 1.0f, 0.8f);
|
||||
|
||||
// Remove one cocoa pod from the inventory
|
||||
if (!a_Player->IsGameModeCreative())
|
||||
{
|
||||
a_Player->GetInventory().RemoveOneEquippedItem();
|
||||
|
@ -1521,6 +1521,20 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
|
||||
return true;
|
||||
}
|
||||
|
||||
case E_BLOCK_COCOA_POD:
|
||||
{
|
||||
NIBBLETYPE TypeMeta = BlockMeta & 0x03;
|
||||
int GrowState = (BlockMeta & 0x0f) >> 2;
|
||||
|
||||
if (GrowState < 2)
|
||||
{
|
||||
GrowState++;
|
||||
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, (NIBBLETYPE) (GrowState << 2 | TypeMeta));
|
||||
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
case E_BLOCK_CROPS:
|
||||
{
|
||||
if (a_IsByBonemeal && !m_IsCropsBonemealable)
|
||||
|
Loading…
Reference in New Issue
Block a user