diff options
author | Mattes D <github@xoft.cz> | 2017-06-15 15:32:33 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-06-16 14:11:28 +0200 |
commit | 0dd1cd750bb51403d85a226a97a5ad93eb99b144 (patch) | |
tree | 8c7a4e8580a780e1ed27f4141c32de7ec3087710 /src/BlockEntities/BeaconEntity.cpp | |
parent | Choose # of threads based on system info (#3644) (diff) | |
download | cuberite-0dd1cd750bb51403d85a226a97a5ad93eb99b144.tar cuberite-0dd1cd750bb51403d85a226a97a5ad93eb99b144.tar.gz cuberite-0dd1cd750bb51403d85a226a97a5ad93eb99b144.tar.bz2 cuberite-0dd1cd750bb51403d85a226a97a5ad93eb99b144.tar.lz cuberite-0dd1cd750bb51403d85a226a97a5ad93eb99b144.tar.xz cuberite-0dd1cd750bb51403d85a226a97a5ad93eb99b144.tar.zst cuberite-0dd1cd750bb51403d85a226a97a5ad93eb99b144.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockEntities/BeaconEntity.cpp | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp index f7728600a..24de9e25c 100644 --- a/src/BlockEntities/BeaconEntity.cpp +++ b/src/BlockEntities/BeaconEntity.cpp @@ -11,13 +11,14 @@ -cBeaconEntity::cBeaconEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World): - super(E_BLOCK_BEACON, a_BlockX, a_BlockY, a_BlockZ, 1, 1, a_World), +cBeaconEntity::cBeaconEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World): + Super(a_BlockType, a_BlockMeta, a_BlockX, a_BlockY, a_BlockZ, 1, 1, a_World), m_IsActive(false), m_BeaconLevel(0), m_PrimaryEffect(cEntityEffect::effNoEffect), m_SecondaryEffect(cEntityEffect::effNoEffect) { + ASSERT(a_BlockType == E_BLOCK_BEACON); UpdateBeacon(); } @@ -268,6 +269,30 @@ void cBeaconEntity::GiveEffects(void) +void cBeaconEntity::CopyFrom(const cBlockEntity & a_Src) +{ + Super::CopyFrom(a_Src); + auto & src = reinterpret_cast<const cBeaconEntity &>(a_Src); + m_BeaconLevel = src.m_BeaconLevel; + m_Contents.CopyFrom(src.m_Contents); + m_IsActive = src.m_IsActive; + m_PrimaryEffect = src.m_PrimaryEffect; + m_SecondaryEffect = src.m_SecondaryEffect; +} + + + + + +void cBeaconEntity::SendTo(cClientHandle & a_Client) +{ + a_Client.SendUpdateBlockEntity(*this); +} + + + + + bool cBeaconEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { // Update the beacon every 4 seconds @@ -306,12 +331,3 @@ bool cBeaconEntity::UsedBy(cPlayer * a_Player) - -void cBeaconEntity::SendTo(cClientHandle & a_Client) -{ - a_Client.SendUpdateBlockEntity(*this); -} - - - - |