summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_11.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2022-01-02 10:48:02 +0100
committerGitHub <noreply@github.com>2022-01-02 10:48:02 +0100
commit1616108af3ab62f818d020610f2246dab0daa827 (patch)
tree21e5589af6dd553233ab705a5c268b2186b90c8a /src/Protocol/Protocol_1_11.cpp
parentUpdate to mybed 3.1.0 (diff)
downloadcuberite-1616108af3ab62f818d020610f2246dab0daa827.tar
cuberite-1616108af3ab62f818d020610f2246dab0daa827.tar.gz
cuberite-1616108af3ab62f818d020610f2246dab0daa827.tar.bz2
cuberite-1616108af3ab62f818d020610f2246dab0daa827.tar.lz
cuberite-1616108af3ab62f818d020610f2246dab0daa827.tar.xz
cuberite-1616108af3ab62f818d020610f2246dab0daa827.tar.zst
cuberite-1616108af3ab62f818d020610f2246dab0daa827.zip
Diffstat (limited to 'src/Protocol/Protocol_1_11.cpp')
-rw-r--r--src/Protocol/Protocol_1_11.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Protocol/Protocol_1_11.cpp b/src/Protocol/Protocol_1_11.cpp
index 7a9a53e6f..2ccc4483a 100644
--- a/src/Protocol/Protocol_1_11.cpp
+++ b/src/Protocol/Protocol_1_11.cpp
@@ -609,10 +609,6 @@ void cProtocol_1_11_0::HandlePacketBlockPlace(cByteBuffer & a_ByteBuffer)
void cProtocol_1_11_0::WriteBlockEntity(cFastNBTWriter & a_Writer, const cBlockEntity & a_BlockEntity) const
{
- a_Writer.AddInt("x", a_BlockEntity.GetPosX());
- a_Writer.AddInt("y", a_BlockEntity.GetPosY());
- a_Writer.AddInt("z", a_BlockEntity.GetPosZ());
-
switch (a_BlockEntity.GetBlockType())
{
case E_BLOCK_BED:
@@ -621,7 +617,6 @@ void cProtocol_1_11_0::WriteBlockEntity(cFastNBTWriter & a_Writer, const cBlockE
a_Writer.AddInt("color", BedEntity.GetColor()); // New: multicoloured beds
break;
}
-
case E_BLOCK_MOB_SPAWNER:
{
auto & MobSpawnerEntity = static_cast<const cMobSpawnerEntity &>(a_BlockEntity);
@@ -631,9 +626,12 @@ void cProtocol_1_11_0::WriteBlockEntity(cFastNBTWriter & a_Writer, const cBlockE
a_Writer.AddShort("Delay", MobSpawnerEntity.GetSpawnDelay());
break;
}
-
- default: Super::WriteBlockEntity(a_Writer, a_BlockEntity);
+ default: return Super::WriteBlockEntity(a_Writer, a_BlockEntity);
}
+
+ a_Writer.AddInt("x", a_BlockEntity.GetPosX());
+ a_Writer.AddInt("y", a_BlockEntity.GetPosY());
+ a_Writer.AddInt("z", a_BlockEntity.GetPosZ());
}