mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Merge branch 'next-minor' into next-major
This commit is contained in:
@ -131,6 +131,7 @@ use pocketmine\world\sound\Sound;
|
||||
use pocketmine\world\World;
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
use function abs;
|
||||
use function array_filter;
|
||||
use function array_map;
|
||||
use function array_shift;
|
||||
use function assert;
|
||||
@ -2280,10 +2281,11 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
$this->getWorld()->dropItem($this->location, $item);
|
||||
}
|
||||
|
||||
$clearInventory = fn(Inventory $inventory) => $inventory->setContents(array_filter($inventory->getContents(), fn(Item $item) => $item->keepOnDeath()));
|
||||
$this->inventory->setHeldItemIndex(0);
|
||||
$this->inventory->clearAll();
|
||||
$this->armorInventory->clearAll();
|
||||
$this->offHandInventory->clearAll();
|
||||
$clearInventory($this->inventory);
|
||||
$clearInventory($this->armorInventory);
|
||||
$clearInventory($this->offHandInventory);
|
||||
}
|
||||
|
||||
if(!$ev->getKeepXp()){
|
||||
|
Reference in New Issue
Block a user