summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2017-09-25 18:17:45 +0200
committerMattes D <github@xoft.cz>2017-09-25 18:17:45 +0200
commit10c5c1227e5a663b3a53c336cfa6a0a98f874265 (patch)
treeb45f06fd4d7ceaca6807113d58d4aba7166d9aa5 /src/Chunk.cpp
parentcBlockArea: Fix performance regression (#4045) (diff)
downloadcuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.gz
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.bz2
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.lz
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.xz
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.tar.zst
cuberite-10c5c1227e5a663b3a53c336cfa6a0a98f874265.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index c29d9917e..0ce18c45e 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -494,7 +494,7 @@ void cChunk::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlock
auto clone = be->Clone(posX, posY, posZ);
clone->SetWorld(m_World);
AddBlockEntityClean(clone);
- BroadcastBlockEntity(posX, posY, posZ);
+ BroadcastBlockEntity({posX, posY, posZ});
}
}
}
@@ -1942,7 +1942,7 @@ bool cChunk::SetSignLines(int a_PosX, int a_PosY, int a_PosZ, const AString & a_
MarkDirty();
auto Sign = static_cast<cSignEntity *>(Entity);
Sign->SetLines(a_Line1, a_Line2, a_Line3, a_Line4);
- m_World->BroadcastBlockEntity(a_PosX, a_PosY, a_PosZ);
+ m_World->BroadcastBlockEntity({a_PosX, a_PosY, a_PosZ});
return true;
}
@@ -2713,7 +2713,7 @@ void cChunk::BroadcastBlockAction(Vector3i a_BlockPos, char a_Byte1, char a_Byte
-void cChunk::BroadcastBlockBreakAnimation(UInt32 a_EntityID, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Stage, const cClientHandle * a_Exclude)
+void cChunk::BroadcastBlockBreakAnimation(UInt32 a_EntityID, Vector3i a_BlockPos, char a_Stage, const cClientHandle * a_Exclude)
{
for (auto itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr)
{
@@ -2721,7 +2721,7 @@ void cChunk::BroadcastBlockBreakAnimation(UInt32 a_EntityID, int a_BlockX, int a
{
continue;
}
- (*itr)->SendBlockBreakAnim(a_EntityID, a_BlockX, a_BlockY, a_BlockZ, a_Stage);
+ (*itr)->SendBlockBreakAnim(a_EntityID, a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, a_Stage);
} // for itr - LoadedByClient[]
}
@@ -2729,10 +2729,10 @@ void cChunk::BroadcastBlockBreakAnimation(UInt32 a_EntityID, int a_BlockX, int a
-void cChunk::BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude)
+void cChunk::BroadcastBlockEntity(Vector3i a_BlockPos, const cClientHandle * a_Exclude)
{
// We can operate on entity pointers, we're inside the ChunkMap's CS lock which guards the list
- cBlockEntity * Entity = GetBlockEntity(a_BlockX, a_BlockY, a_BlockZ);
+ cBlockEntity * Entity = GetBlockEntity(a_BlockPos);
if (Entity == nullptr)
{
return;