diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-08 00:45:33 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-08 00:45:33 +0100 |
commit | 838d4d5d1d9be001357d6795a343244a43652e2f (patch) | |
tree | dbc89a04d9fdd542601397dc6d7d4a963c8f6399 | |
parent | Console trims its commands before executing 'em (diff) | |
download | cuberite-838d4d5d1d9be001357d6795a343244a43652e2f.tar cuberite-838d4d5d1d9be001357d6795a343244a43652e2f.tar.gz cuberite-838d4d5d1d9be001357d6795a343244a43652e2f.tar.bz2 cuberite-838d4d5d1d9be001357d6795a343244a43652e2f.tar.lz cuberite-838d4d5d1d9be001357d6795a343244a43652e2f.tar.xz cuberite-838d4d5d1d9be001357d6795a343244a43652e2f.tar.zst cuberite-838d4d5d1d9be001357d6795a343244a43652e2f.zip |
-rw-r--r-- | src/Items/ItemDye.h | 5 | ||||
-rw-r--r-- | src/World.cpp | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Items/ItemDye.h b/src/Items/ItemDye.h index 99b8d2543..190cdc510 100644 --- a/src/Items/ItemDye.h +++ b/src/Items/ItemDye.h @@ -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 { - // TODO: Handle coloring the sheep, too (OnItemUseOnEntity maybe) - // Handle growing the plants: if (a_Item.m_ItemDamage == E_META_DYE_WHITE) { 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(); return true; diff --git a/src/World.cpp b/src/World.cpp index 2da4a89be..41f08d97f 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1259,6 +1259,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy if (BlockMeta < 7) { FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7); + BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0); } return true; } @@ -1272,6 +1273,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy if (BlockMeta < 7) { FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7); + BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0); } return true; } @@ -1285,6 +1287,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy return false; } FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7); + BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0); } else { @@ -1306,6 +1309,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy if (BlockMeta < 7) { FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7); + BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0); } return true; } @@ -1319,6 +1323,7 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy return false; } FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, 7); + BroadcastSoundParticleEffect(2005, a_BlockX, a_BlockY, a_BlockZ, 0); } 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) 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 return true; } |