mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
Level: fixed blocks not dropping when not broken by player
closes #2172
This commit is contained in:
parent
f497e43db3
commit
197102ca3d
@ -1666,10 +1666,12 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
$drops = [];
|
||||
$xpDrop = 0;
|
||||
|
||||
if($player !== null and !$player->isCreative()){
|
||||
if($player === null or !$player->isCreative()){
|
||||
$drops = array_merge(...array_map(function(Block $block) use ($item) : array{ return $block->getDrops($item); }, $affectedBlocks));
|
||||
}
|
||||
|
||||
$xpDrop = 0;
|
||||
if($player !== null and !$player->isCreative()){
|
||||
$xpDrop = array_sum(array_map(function(Block $block) use ($item) : int{ return $block->getXpDropForTool($item); }, $affectedBlocks));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user