mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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 = [];
|
$drops = [];
|
||||||
$xpDrop = 0;
|
if($player === null or !$player->isCreative()){
|
||||||
|
|
||||||
if($player !== null and !$player->isCreative()){
|
|
||||||
$drops = array_merge(...array_map(function(Block $block) use ($item) : array{ return $block->getDrops($item); }, $affectedBlocks));
|
$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));
|
$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