summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-09-27 23:22:15 +0200
committerAlexander Harkness <me@bearbin.net>2017-09-27 23:22:15 +0200
commit8866a28cf835fd3f814d4413ab2b5883999e2065 (patch)
tree343c757980b219b25eab9182fb8f1ede59d59468 /src/ChunkMap.cpp
parentcPressurePlateHandler: Fix uninitialised variables. (#4047) (diff)
downloadcuberite-8866a28cf835fd3f814d4413ab2b5883999e2065.tar
cuberite-8866a28cf835fd3f814d4413ab2b5883999e2065.tar.gz
cuberite-8866a28cf835fd3f814d4413ab2b5883999e2065.tar.bz2
cuberite-8866a28cf835fd3f814d4413ab2b5883999e2065.tar.lz
cuberite-8866a28cf835fd3f814d4413ab2b5883999e2065.tar.xz
cuberite-8866a28cf835fd3f814d4413ab2b5883999e2065.tar.zst
cuberite-8866a28cf835fd3f814d4413ab2b5883999e2065.zip
Diffstat (limited to 'src/ChunkMap.cpp')
-rw-r--r--src/ChunkMap.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index 30bab923d..d970956f3 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -19,6 +19,7 @@
#include "Blocks/ChunkInterface.h"
#include "Entities/Pickup.h"
#include "DeadlockDetect.h"
+#include "BlockEntities/BlockEntity.h"
#ifndef _WIN32
#include <cstdlib> // abs
@@ -1763,6 +1764,18 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_
}
}
+ // Destroy any block entities
+ if (cBlockEntity::IsBlockEntityBlockType(Block))
+ {
+ Vector3i BlockPos(bx + x, by + y, bz + z);
+ DoWithBlockEntityAt(BlockPos.x, BlockPos.y, BlockPos.z, [](cBlockEntity & a_BE)
+ {
+ a_BE.Destroy();
+ return true;
+ }
+ );
+ }
+
area.SetBlockTypeMeta(bx + x, by + y, bz + z, E_BLOCK_AIR, 0);
a_BlocksAffected.push_back(Vector3i(bx + x, by + y, bz + z));
break;