summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemLighter.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-04-02 15:05:55 +0200
committerTycho <work.tycho+git@gmail.com>2014-04-02 15:05:55 +0200
commitdcaea749ae502366c23f2c04f3b42882cb71d0d6 (patch)
tree56e499098895a03bc66beac5aa33ba4ee261f17e /src/Items/ItemLighter.h
parentMerge branch 'master' into globals (diff)
parentMerge pull request #831 from mc-server/Wither (diff)
downloadcuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.gz
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.bz2
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.lz
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.xz
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.tar.zst
cuberite-dcaea749ae502366c23f2c04f3b42882cb71d0d6.zip
Diffstat (limited to 'src/Items/ItemLighter.h')
-rw-r--r--src/Items/ItemLighter.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/Items/ItemLighter.h b/src/Items/ItemLighter.h
index 18873e911..32f49cab6 100644
--- a/src/Items/ItemLighter.h
+++ b/src/Items/ItemLighter.h
@@ -26,7 +26,26 @@ public:
return false;
}
- a_Player->UseEquippedItem();
+ if (!a_Player->IsGameModeCreative())
+ {
+ switch (m_ItemType)
+ {
+ case E_ITEM_FLINT_AND_STEEL:
+ {
+ a_Player->UseEquippedItem();
+ break;
+ }
+ case E_ITEM_FIRE_CHARGE:
+ {
+ a_Player->GetInventory().RemoveOneEquippedItem();
+ break;
+ }
+ default:
+ {
+ ASSERT(!"Unknown Lighter Item!");
+ }
+ }
+ }
switch (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ))
{
@@ -34,8 +53,8 @@ public:
{
// Activate the TNT:
a_World->BroadcastSoundEffect("game.tnt.primed", a_BlockX * 8, a_BlockY * 8, a_BlockZ * 8, 1.0f, 1.0f);
- a_World->SpawnPrimedTNT(a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5); // 80 ticks to boom
a_World->SetBlock(a_BlockX,a_BlockY,a_BlockZ, E_BLOCK_AIR, 0);
+ a_World->SpawnPrimedTNT(a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5); // 80 ticks to boom
break;
}
default:
@@ -49,6 +68,7 @@ public:
if (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ) == E_BLOCK_AIR)
{
a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FIRE, 0);
+ a_World->BroadcastSoundEffect("fire.ignite", a_BlockX * 8, a_BlockY * 8, a_BlockZ * 8, 1.0F, 1.04F);
break;
}
}