summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-10-18 20:54:34 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-10-18 20:54:34 +0200
commit6a22b63473d465027b8d328d2ab621c596d1ee84 (patch)
treecae8b6e124f87f96db54ab6e284e51299d1c3019 /src/BlockEntities
parentSimpler code. (diff)
downloadcuberite-6a22b63473d465027b8d328d2ab621c596d1ee84.tar
cuberite-6a22b63473d465027b8d328d2ab621c596d1ee84.tar.gz
cuberite-6a22b63473d465027b8d328d2ab621c596d1ee84.tar.bz2
cuberite-6a22b63473d465027b8d328d2ab621c596d1ee84.tar.lz
cuberite-6a22b63473d465027b8d328d2ab621c596d1ee84.tar.xz
cuberite-6a22b63473d465027b8d328d2ab621c596d1ee84.tar.zst
cuberite-6a22b63473d465027b8d328d2ab621c596d1ee84.zip
Diffstat (limited to '')
-rw-r--r--src/BlockEntities/FurnaceEntity.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/BlockEntities/FurnaceEntity.cpp b/src/BlockEntities/FurnaceEntity.cpp
index 898d348de..284ac7de9 100644
--- a/src/BlockEntities/FurnaceEntity.cpp
+++ b/src/BlockEntities/FurnaceEntity.cpp
@@ -24,11 +24,11 @@ enum
cFurnaceEntity::cFurnaceEntity(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cWorld * a_World) :
- super(E_BLOCK_FURNACE, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World),
+ super(a_BlockType, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World),
m_BlockMeta(a_BlockMeta),
m_CurrentRecipe(NULL),
m_IsDestroyed(false),
- m_IsCooking((a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ) == E_BLOCK_LIT_FURNACE)),
+ m_IsCooking(a_BlockType == E_BLOCK_LIT_FURNACE),
m_NeedCookTime(0),
m_TimeCooked(0),
m_FuelBurnTime(0),
@@ -100,6 +100,7 @@ bool cFurnaceEntity::Tick(float a_Dt, cChunk & a_Chunk)
m_TimeCooked = std::max((m_TimeCooked - 2), 0);
// Reset progressbars, block type, and bail out
+ m_BlockType = E_BLOCK_FURNACE;
a_Chunk.FastSetBlock(GetRelX(), m_PosY, GetRelZ(), E_BLOCK_FURNACE, m_BlockMeta);
UpdateProgressBars();
return false;
@@ -368,6 +369,7 @@ void cFurnaceEntity::SetIsCooking(bool a_IsCooking)
// Only light the furnace as it is extinguished only when the fuel runs out, not when cooking stops - handled in this::Tick()
if (m_IsCooking)
{
+ m_BlockType = E_BLOCK_LIT_FURNACE;
m_World->FastSetBlock(m_PosX, m_PosY, m_PosZ, E_BLOCK_LIT_FURNACE, m_BlockMeta);
}
}