mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
Fixed error with useBreakOn parameters
A E_RECOVERABLE_ERROR error happened: "Argument 1 passed to pocketmine\block\Block::getDrops() must be an instance of pocketmine\item\Item, null given AND A E_RECOVERABLE_ERROR error happened: "Argument 1 passed to pocketmine\block\Generic::onBreak() must be an instance of pocketmine\item\Item, null given are fixed
This commit is contained in:
parent
21587ae3eb
commit
3eae7a1875
@ -776,6 +776,10 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$target = $this->getBlock($vector);
|
$target = $this->getBlock($vector);
|
||||||
//TODO: Adventure mode checks
|
//TODO: Adventure mode checks
|
||||||
|
|
||||||
|
if($item == null){
|
||||||
|
$item = new Item(AIR);
|
||||||
|
}
|
||||||
|
|
||||||
if($player instanceof Player){
|
if($player instanceof Player){
|
||||||
$ev = new BlockBreakEvent($player, $target, $item, ($player->getGamemode() & 0x01) === 1 ? true : false);
|
$ev = new BlockBreakEvent($player, $target, $item, ($player->getGamemode() & 0x01) === 1 ? true : false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user