diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-30 22:54:19 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-30 22:54:19 +0200 |
commit | e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63 (patch) | |
tree | 40ec8a900f4e8e56f540a2ec664475fe677c0a17 /src/BlockEntities/BeaconEntity.cpp | |
parent | Added beacon load/save. (diff) | |
download | cuberite-e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63.tar cuberite-e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63.tar.gz cuberite-e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63.tar.bz2 cuberite-e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63.tar.lz cuberite-e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63.tar.xz cuberite-e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63.tar.zst cuberite-e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockEntities/BeaconEntity.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp index 38b710181..30d927663 100644 --- a/src/BlockEntities/BeaconEntity.cpp +++ b/src/BlockEntities/BeaconEntity.cpp @@ -127,6 +127,12 @@ bool cBeaconEntity::SelectPrimaryPotion(cEntityEffect::eType a_Potion) } m_PrimaryPotion = a_Potion; + + // Send window update: + if (GetWindow() != NULL) + { + GetWindow()->SetProperty(1, m_PrimaryPotion); + } return true; } @@ -142,6 +148,12 @@ bool cBeaconEntity::SelectSecondaryPotion(cEntityEffect::eType a_Potion) } m_SecondaryPotion = a_Potion; + + // Send window update: + if (GetWindow() != NULL) + { + GetWindow()->SetProperty(2, m_SecondaryPotion); + } return true; } @@ -189,6 +201,8 @@ bool cBeaconEntity::IsMineralBlock(BLOCKTYPE a_BlockType) void cBeaconEntity::UpdateBeacon(void) { + int OldBeaconLevel = m_BeaconLevel; + if (IsBeaconBlocked()) { m_IsActive = false; @@ -200,6 +214,15 @@ void cBeaconEntity::UpdateBeacon(void) m_IsActive = (m_BeaconLevel > 0); } + if (m_BeaconLevel != OldBeaconLevel) + { + // Send window update: + if (GetWindow() != NULL) + { + GetWindow()->SetProperty(0, m_BeaconLevel); + } + } + // TODO: Add achievement } |