Bonemeal has particles, fixes #393
This commit is contained in:
parent
b779d84663
commit
838d4d5d1d
@ -21,14 +21,13 @@ public:
|
|||||||
|
|
||||||
virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir) override
|
virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir) override
|
||||||
{
|
{
|
||||||
// TODO: Handle coloring the sheep, too (OnItemUseOnEntity maybe)
|
|
||||||
|
|
||||||
// Handle growing the plants:
|
// Handle growing the plants:
|
||||||
if (a_Item.m_ItemDamage == E_META_DYE_WHITE)
|
if (a_Item.m_ItemDamage == E_META_DYE_WHITE)
|
||||||
{
|
{
|
||||||
if (a_World->GrowRipePlant(a_BlockX, a_BlockY, a_BlockZ, true))
|
if (a_World->GrowRipePlant(a_BlockX, a_BlockY, a_BlockZ, true))
|
||||||
{
|
{
|
||||||
if (a_Player->GetGameMode() != gmCreative)
|
// Particle effects are in GrowRipePlant
|
||||||
|
if (!a_Player->IsGameModeCreative())
|
||||||
{
|
{
|
||||||
a_Player->GetInventory().RemoveOneEquippedItem();
|
a_Player->GetInventory().RemoveOneEquippedItem();
|
||||||
return true;
|
return true;
|
||||||
|
@ -1259,6 +1259,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
|
|||||||
if (BlockMeta < 7)
|
if (BlockMeta < 7)
|
||||||
{
|
{
|
||||||
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
||||||
|
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1272,6 +1273,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
|
|||||||
if (BlockMeta < 7)
|
if (BlockMeta < 7)
|
||||||
{
|
{
|
||||||
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
||||||
|
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1285,6 +1287,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
||||||
|
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1306,6 +1309,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
|
|||||||
if (BlockMeta < 7)
|
if (BlockMeta < 7)
|
||||||
{
|
{
|
||||||
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
||||||
|
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1319,6 +1323,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7);
|
||||||
|
BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1377,6 +1382,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy
|
|||||||
}
|
}
|
||||||
} // switch (random spawn block type)
|
} // switch (random spawn block type)
|
||||||
FastSetBlock(a_BlockX + OfsX, a_BlockY + OfsY + 1, a_BlockZ + OfsZ, SpawnType, SpawnMeta);
|
FastSetBlock(a_BlockX + OfsX, a_BlockY + OfsY + 1, a_BlockZ + OfsZ, SpawnType, SpawnMeta);
|
||||||
|
BroadcastSoundParticleEffect(2005, a_BlockX + OfsX, a_BlockY + OfsY, a_BlockZ + OfsZ, 0);
|
||||||
} // for i - 50 times
|
} // for i - 50 times
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user