diff options
author | madmaxoft <github@xoft.cz> | 2013-11-01 11:14:55 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-11-01 11:14:55 +0100 |
commit | 62d27e4ed96fcc009d12c8788dee6bc5adb9e80f (patch) | |
tree | 486ce5c339819761a032392c64a1f066bdf27f91 /source/ChunkMap.cpp | |
parent | Protocol 1.7: Added skeleton functions for reading client packets. (diff) | |
parent | TNT Spawns Pickups (diff) | |
download | cuberite-62d27e4ed96fcc009d12c8788dee6bc5adb9e80f.tar cuberite-62d27e4ed96fcc009d12c8788dee6bc5adb9e80f.tar.gz cuberite-62d27e4ed96fcc009d12c8788dee6bc5adb9e80f.tar.bz2 cuberite-62d27e4ed96fcc009d12c8788dee6bc5adb9e80f.tar.lz cuberite-62d27e4ed96fcc009d12c8788dee6bc5adb9e80f.tar.xz cuberite-62d27e4ed96fcc009d12c8788dee6bc5adb9e80f.tar.zst cuberite-62d27e4ed96fcc009d12c8788dee6bc5adb9e80f.zip |
Diffstat (limited to 'source/ChunkMap.cpp')
-rw-r--r-- | source/ChunkMap.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp index c3bd5f33d..d9de24cff 100644 --- a/source/ChunkMap.cpp +++ b/source/ChunkMap.cpp @@ -12,6 +12,7 @@ #include "BlockArea.h" #include "PluginManager.h" #include "Entities/TNTEntity.h" +#include "Blocks/BlockHandler.h" #include "MobCensus.h" #include "MobSpawner.h" @@ -1610,7 +1611,9 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_ // Too far away continue; } - switch (area.GetBlockType(bx + x, by + y, bz + z)) + + BLOCKTYPE Block = area.GetBlockType(bx + x, by + y, bz + z); + switch (Block) { case E_BLOCK_TNT: { @@ -1644,8 +1647,22 @@ void cChunkMap::DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_ break; } + case E_BLOCK_AIR: + { + // No pickups for air + break; + } + default: { + if (m_World->GetTickRandomNumber(10) == 5) + { + cItems Drops; + cBlockHandler * Handler = BlockHandler(Block); + + Handler->ConvertToPickups(Drops, area.GetBlockMeta(bx + x, by + y, bz + z)); + m_World->SpawnItemPickups(Drops, bx + x, by + y, bz + z); + } area.SetBlockType(bx + x, by + y, bz + z, E_BLOCK_AIR); a_BlocksAffected.push_back(Vector3i(bx + x, by + y, bz + z)); } |