summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/BeaconEntity.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-09-29 14:59:24 +0200
committerGitHub <noreply@github.com>2019-09-29 14:59:24 +0200
commit365cbc6e1cea96741e26c9ce912b003f8fd2c62c (patch)
treef23682c47928597791c53f3a300b03494ffde417 /src/BlockEntities/BeaconEntity.cpp
parentCactus can now grow and will be dropped if there is no place to grow. (diff)
downloadcuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.gz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.bz2
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.lz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.xz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.zst
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.zip
Diffstat (limited to '')
-rw-r--r--src/BlockEntities/BeaconEntity.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp
index f1f7341b7..4c830fb61 100644
--- a/src/BlockEntities/BeaconEntity.cpp
+++ b/src/BlockEntities/BeaconEntity.cpp
@@ -11,8 +11,8 @@
-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),
+cBeaconEntity::cBeaconEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World):
+ super(a_BlockType, a_BlockMeta, a_Pos, 1, 1, a_World),
m_IsActive(false),
m_BeaconLevel(0),
m_PrimaryEffect(cEntityEffect::effNoEffect),
@@ -138,9 +138,9 @@ bool cBeaconEntity::SetSecondaryEffect(cEntityEffect::eType a_Effect)
bool cBeaconEntity::IsBeaconBlocked(void)
{
- for (int Y = m_PosY; Y < cChunkDef::Height; ++Y)
+ for (int Y = m_Pos.y; Y < cChunkDef::Height; ++Y)
{
- BLOCKTYPE Block = m_World->GetBlock(m_PosX, Y, m_PosZ);
+ BLOCKTYPE Block = m_World->GetBlock({m_Pos.x, Y, m_Pos.z});
if (!cBlockInfo::IsTransparent(Block))
{
return true;
@@ -195,7 +195,7 @@ void cBeaconEntity::UpdateBeacon(void)
GetWindow()->SetProperty(0, m_BeaconLevel);
}
- Vector3d BeaconPosition(m_PosX, m_PosY, m_PosZ);
+ Vector3d BeaconPosition(m_Pos);
GetWorld()->ForEachPlayer([=](cPlayer & a_Player)
{
Vector3d Distance = BeaconPosition - a_Player.GetPosition();
@@ -233,7 +233,7 @@ void cBeaconEntity::GiveEffects(void)
bool HasSecondaryEffect = (m_BeaconLevel >= 4) && (m_PrimaryEffect != m_SecondaryEffect) && (m_SecondaryEffect > 0);
- Vector3d BeaconPosition(m_PosX, m_PosY, m_PosZ);
+ Vector3d BeaconPosition(m_Pos);
GetWorld()->ForEachPlayer([=](cPlayer & a_Player)
{
auto PlayerPosition = a_Player.GetPosition();
@@ -263,7 +263,7 @@ void cBeaconEntity::GiveEffects(void)
void cBeaconEntity::CopyFrom(const cBlockEntity & a_Src)
{
- Super::CopyFrom(a_Src);
+ super::CopyFrom(a_Src);
auto & src = static_cast<const cBeaconEntity &>(a_Src);
m_BeaconLevel = src.m_BeaconLevel;
m_Contents.CopyFrom(src.m_Contents);
@@ -305,7 +305,7 @@ bool cBeaconEntity::UsedBy(cPlayer * a_Player)
cWindow * Window = GetWindow();
if (Window == nullptr)
{
- OpenWindow(new cBeaconWindow(m_PosX, m_PosY, m_PosZ, this));
+ OpenWindow(new cBeaconWindow(this));
Window = GetWindow();
}